[#4181] Added routes for the Deliverables.

This commit is contained in:
Eric Davis
2010-06-23 14:53:23 -07:00
parent f21d5fa2b4
commit 2bb36cb550
4 changed files with 22 additions and 2 deletions
@@ -0,0 +1,5 @@
class DeliverablesController < InheritedResources::Base
unloadable
respond_to :html
end
+3 -1
View File
@@ -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
+2
View File
@@ -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 -1
View File
@@ -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