[#4181] Added routes for the Deliverables.
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
class DeliverablesController < InheritedResources::Base
|
||||
unloadable
|
||||
|
||||
respond_to :html
|
||||
end
|
||||
+3
-1
@@ -1,3 +1,5 @@
|
||||
ActionController::Routing::Routes.draw do |map|
|
||||
map.resources :contracts, :path_prefix => '/projects/:project_id'
|
||||
map.resources :contracts, :path_prefix => '/projects/:project_id' do |contracts|
|
||||
contracts.resources :deliverables
|
||||
end
|
||||
end
|
||||
|
||||
@@ -19,4 +19,6 @@ class ContractsShowTest < ActionController::IntegrationTest
|
||||
assert_select 'h2', :text => @contract.name
|
||||
end
|
||||
end
|
||||
|
||||
should "show a list of deliverables for the contract"
|
||||
end
|
||||
|
||||
@@ -12,7 +12,18 @@ class RoutingTest < ActionController::IntegrationTest
|
||||
should_route :put, "/projects/world_domination/contracts/1", :controller => 'contracts', :action => 'update', :id => '1', :project_id => 'world_domination'
|
||||
|
||||
should_route :delete, "/projects/world_domination/contracts/1", :controller => 'contracts', :action => 'destroy', :id => '1', :project_id => 'world_domination'
|
||||
|
||||
end
|
||||
|
||||
context "deliverables" do
|
||||
should_route :get, "/projects/world_domination/contracts/1/deliverables", :controller => 'deliverables', :action => 'index', :project_id => 'world_domination', :contract_id => '1'
|
||||
should_route :get, "/projects/world_domination/contracts/1/deliverables/new", :controller => 'deliverables', :action => 'new', :project_id => 'world_domination', :contract_id => '1'
|
||||
should_route :get, "/projects/world_domination/contracts/1/deliverables/10", :controller => 'deliverables', :action => 'show', :id => '10', :project_id => 'world_domination', :contract_id => '1'
|
||||
should_route :get, "/projects/world_domination/contracts/1/deliverables/10/edit", :controller => 'deliverables', :action => 'edit', :id => '10', :project_id => 'world_domination', :contract_id => '1'
|
||||
|
||||
should_route :post, "/projects/world_domination/contracts/1/deliverables", :controller => 'deliverables', :action => 'create', :project_id => 'world_domination', :contract_id => '1'
|
||||
|
||||
should_route :put, "/projects/world_domination/contracts/1/deliverables/10", :controller => 'deliverables', :action => 'update', :id => '10', :project_id => 'world_domination', :contract_id => '1'
|
||||
|
||||
should_route :delete, "/projects/world_domination/contracts/1/deliverables/10", :controller => 'deliverables', :action => 'destroy', :id => '10', :project_id => 'world_domination', :contract_id => '1'
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user