test: replace "should_route" of "boards" to "assert_routing" at integration/routing_test.rb

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8205 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Toshi MARUYAMA 2011-12-14 13:05:42 +00:00
parent 98fb0dd565
commit 08e8567e93
1 changed files with 36 additions and 11 deletions

View File

@ -58,17 +58,42 @@ class RoutingTest < ActionController::IntegrationTest
)
end
context "boards" do
should_route :get, "/projects/world_domination/boards", :controller => 'boards', :action => 'index', :project_id => 'world_domination'
should_route :get, "/projects/world_domination/boards/new", :controller => 'boards', :action => 'new', :project_id => 'world_domination'
should_route :get, "/projects/world_domination/boards/44", :controller => 'boards', :action => 'show', :project_id => 'world_domination', :id => '44'
should_route :get, "/projects/world_domination/boards/44.atom", :controller => 'boards', :action => 'show', :project_id => 'world_domination', :id => '44', :format => 'atom'
should_route :get, "/projects/world_domination/boards/44/edit", :controller => 'boards', :action => 'edit', :project_id => 'world_domination', :id => '44'
should_route :post, "/projects/world_domination/boards", :controller => 'boards', :action => 'create', :project_id => 'world_domination'
should_route :put, "/projects/world_domination/boards/44", :controller => 'boards', :action => 'update', :project_id => 'world_domination', :id => '44'
should_route :delete, "/projects/world_domination/boards/44", :controller => 'boards', :action => 'destroy', :project_id => 'world_domination', :id => '44'
def test_boards
assert_routing(
{ :method => 'get', :path => "/projects/world_domination/boards" },
{ :controller => 'boards', :action => 'index', :project_id => 'world_domination' }
)
assert_routing(
{ :method => 'get', :path => "/projects/world_domination/boards/new" },
{ :controller => 'boards', :action => 'new', :project_id => 'world_domination' }
)
assert_routing(
{ :method => 'get', :path => "/projects/world_domination/boards/44" },
{ :controller => 'boards', :action => 'show', :project_id => 'world_domination',
:id => '44' }
)
assert_routing(
{ :method => 'get', :path => "/projects/world_domination/boards/44.atom" },
{ :controller => 'boards', :action => 'show', :project_id => 'world_domination',
:id => '44', :format => 'atom' }
)
assert_routing(
{ :method => 'get', :path => "/projects/world_domination/boards/44/edit" },
{ :controller => 'boards', :action => 'edit', :project_id => 'world_domination',
:id => '44' }
)
assert_routing(
{ :method => 'post', :path => "/projects/world_domination/boards" },
{ :controller => 'boards', :action => 'create', :project_id => 'world_domination' }
)
assert_routing(
{ :method => 'put', :path => "/projects/world_domination/boards/44" },
{ :controller => 'boards', :action => 'update', :project_id => 'world_domination', :id => '44' }
)
assert_routing(
{ :method => 'delete', :path => "/projects/world_domination/boards/44" },
{ :controller => 'boards', :action => 'destroy', :project_id => 'world_domination', :id => '44' }
)
end
context "custom_fields" do