Commit 698b4b837976b5c961e476b4ae7006a4f3fa637e
Committed by
Rafael Manzo
1 parent
39b73787
Exists in
colab
and in
4 other branches
Routes for ModulesController module tree method
Signed-off By : Rafael Reggiani Manzo <rr.manzo@gmail.com>
Showing
3 changed files
with
14 additions
and
0 deletions
Show diff stats
app/controllers/modules_controller.rb
@@ -30,5 +30,8 @@ class ModulesController < ApplicationController | @@ -30,5 +30,8 @@ class ModulesController < ApplicationController | ||
30 | 30 | ||
31 | graphic.to_blob | 31 | graphic.to_blob |
32 | end | 32 | end |
33 | + | ||
34 | + # POST /project/1/repositories/42/modules/24 | ||
35 | + def load_tree; end | ||
33 | 36 | ||
34 | end | 37 | end |
35 | \ No newline at end of file | 38 | \ No newline at end of file |
config/routes.rb
@@ -8,6 +8,7 @@ Mezuro::Application.routes.draw do | @@ -8,6 +8,7 @@ Mezuro::Application.routes.draw do | ||
8 | resources :repositories, except: [:update, :index] | 8 | resources :repositories, except: [:update, :index] |
9 | get '/repositories/:id/modules/:module_result_id' => 'repositories#show', as: :repository_module | 9 | get '/repositories/:id/modules/:module_result_id' => 'repositories#show', as: :repository_module |
10 | put '/repositories/:id' => 'repositories#update', as: :repository_update | 10 | put '/repositories/:id' => 'repositories#update', as: :repository_update |
11 | + post '/repositories/:id/modules/:module_result_id' => 'modules#load_tree', as: :load_module_tree | ||
11 | end | 12 | end |
12 | 13 | ||
13 | #resources :modules | 14 | #resources :modules |
@@ -0,0 +1,10 @@ | @@ -0,0 +1,10 @@ | ||
1 | +require "spec_helper" | ||
2 | + | ||
3 | +describe ModulesController do | ||
4 | + describe "routing" do | ||
5 | + it { should route(:post, '/projects/1/repositories/42/modules/24'). | ||
6 | + to(controller: :modules, action: :load_tree, project_id: 1, id: 42, module_result_id: 24) } | ||
7 | + it { should route(:get, '/modules/metric_history'). | ||
8 | + to(controller: :modules, action: :metric_history) } | ||
9 | + end | ||
10 | +end | ||
0 | \ No newline at end of file | 11 | \ No newline at end of file |