Commit 698b4b837976b5c961e476b4ae7006a4f3fa637e

Authored by Fellipe Souto
Committed by Rafael Manzo
1 parent 39b73787

Routes for ModulesController module tree method

Signed-off By : Rafael Reggiani Manzo <rr.manzo@gmail.com>
app/controllers/modules_controller.rb
... ... @@ -30,5 +30,8 @@ class ModulesController &lt; ApplicationController
30 30  
31 31 graphic.to_blob
32 32 end
  33 +
  34 + # POST /project/1/repositories/42/modules/24
  35 + def load_tree; end
33 36  
34 37 end
35 38 \ No newline at end of file
... ...
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
... ...
spec/routing/modules_routing_spec.rb 0 → 100644
... ... @@ -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
... ...