diff --git a/app/controllers/modules_controller.rb b/app/controllers/modules_controller.rb index ffe5b88..376dcf5 100644 --- a/app/controllers/modules_controller.rb +++ b/app/controllers/modules_controller.rb @@ -30,5 +30,8 @@ class ModulesController < ApplicationController graphic.to_blob end + + # POST /project/1/repositories/42/modules/24 + def load_tree; end end \ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index 3654ed1..1f77e11 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -8,6 +8,7 @@ Mezuro::Application.routes.draw do resources :repositories, except: [:update, :index] get '/repositories/:id/modules/:module_result_id' => 'repositories#show', as: :repository_module put '/repositories/:id' => 'repositories#update', as: :repository_update + post '/repositories/:id/modules/:module_result_id' => 'modules#load_tree', as: :load_module_tree end #resources :modules diff --git a/spec/routing/modules_routing_spec.rb b/spec/routing/modules_routing_spec.rb new file mode 100644 index 0000000..e8ec703 --- /dev/null +++ b/spec/routing/modules_routing_spec.rb @@ -0,0 +1,10 @@ +require "spec_helper" + +describe ModulesController do + describe "routing" do + it { should route(:post, '/projects/1/repositories/42/modules/24'). + to(controller: :modules, action: :load_tree, project_id: 1, id: 42, module_result_id: 24) } + it { should route(:get, '/modules/metric_history'). + to(controller: :modules, action: :metric_history) } + end +end \ No newline at end of file -- libgit2 0.21.2