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
config/routes.rb
... | ... | @@ -8,6 +8,7 @@ Mezuro::Application.routes.draw do |
8 | 8 | resources :repositories, except: [:update, :index] |
9 | 9 | get '/repositories/:id/modules/:module_result_id' => 'repositories#show', as: :repository_module |
10 | 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 | 12 | end |
12 | 13 | |
13 | 14 | #resources :modules | ... | ... |
... | ... | @@ -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 | 11 | \ No newline at end of file | ... | ... |