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

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8223 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Toshi MARUYAMA 2011-12-15 08:39:55 +00:00
parent 64129a68cd
commit f92141decb

View File

@ -362,15 +362,40 @@ class RoutingTest < ActionController::IntegrationTest
)
end
context "messages" do
should_route :get, "/boards/22/topics/2", :controller => 'messages', :action => 'show', :id => '2', :board_id => '22'
should_route :get, "/boards/lala/topics/new", :controller => 'messages', :action => 'new', :board_id => 'lala'
should_route :get, "/boards/lala/topics/22/edit", :controller => 'messages', :action => 'edit', :id => '22', :board_id => 'lala'
should_route :post, "/boards/lala/topics/new", :controller => 'messages', :action => 'new', :board_id => 'lala'
should_route :post, "/boards/lala/topics/22/edit", :controller => 'messages', :action => 'edit', :id => '22', :board_id => 'lala'
should_route :post, "/boards/22/topics/555/replies", :controller => 'messages', :action => 'reply', :id => '555', :board_id => '22'
should_route :post, "/boards/22/topics/555/destroy", :controller => 'messages', :action => 'destroy', :id => '555', :board_id => '22'
def test_messages
assert_routing(
{ :method => 'get', :path => "/boards/22/topics/2" },
{ :controller => 'messages', :action => 'show', :id => '2',
:board_id => '22' }
)
assert_routing(
{ :method => 'get', :path => "/boards/lala/topics/new" },
{ :controller => 'messages', :action => 'new', :board_id => 'lala' }
)
assert_routing(
{ :method => 'get', :path => "/boards/lala/topics/22/edit" },
{ :controller => 'messages', :action => 'edit', :id => '22',
:board_id => 'lala' }
)
assert_routing(
{ :method => 'post', :path => "/boards/lala/topics/new" },
{ :controller => 'messages', :action => 'new', :board_id => 'lala' }
)
assert_routing(
{ :method => 'post', :path => "/boards/lala/topics/22/edit" },
{ :controller => 'messages', :action => 'edit', :id => '22',
:board_id => 'lala' }
)
assert_routing(
{ :method => 'post', :path => "/boards/22/topics/555/replies" },
{ :controller => 'messages', :action => 'reply', :id => '555',
:board_id => '22' }
)
assert_routing(
{ :method => 'post', :path => "/boards/22/topics/555/destroy" },
{ :controller => 'messages', :action => 'destroy', :id => '555',
:board_id => '22' }
)
end
context "news" do