test: replace "should_route" of "timelogs (global)" to "assert_routing" at integration/routing_test.rb

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8242 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Toshi MARUYAMA 2011-12-16 04:01:44 +00:00
parent 5a33d7292f
commit e2de7f2529

View File

@ -520,18 +520,39 @@ class RoutingTest < ActionController::IntegrationTest
should_route :post, "/roles/permissions", :controller => 'roles', :action => 'permissions'
end
context "timelogs (global)" do
should_route :get, "/time_entries", :controller => 'timelog', :action => 'index'
should_route :get, "/time_entries.csv", :controller => 'timelog', :action => 'index', :format => 'csv'
should_route :get, "/time_entries.atom", :controller => 'timelog', :action => 'index', :format => 'atom'
should_route :get, "/time_entries/new", :controller => 'timelog', :action => 'new'
should_route :get, "/time_entries/22/edit", :controller => 'timelog', :action => 'edit', :id => '22'
should_route :post, "/time_entries", :controller => 'timelog', :action => 'create'
should_route :put, "/time_entries/22", :controller => 'timelog', :action => 'update', :id => '22'
should_route :delete, "/time_entries/55", :controller => 'timelog', :action => 'destroy', :id => '55'
def test_timelogs_global
assert_routing(
{ :method => 'get', :path => "/time_entries" },
{ :controller => 'timelog', :action => 'index' }
)
assert_routing(
{ :method => 'get', :path => "/time_entries.csv" },
{ :controller => 'timelog', :action => 'index', :format => 'csv' }
)
assert_routing(
{ :method => 'get', :path => "/time_entries.atom" },
{ :controller => 'timelog', :action => 'index', :format => 'atom' }
)
assert_routing(
{ :method => 'get', :path => "/time_entries/new" },
{ :controller => 'timelog', :action => 'new' }
)
assert_routing(
{ :method => 'get', :path => "/time_entries/22/edit" },
{ :controller => 'timelog', :action => 'edit', :id => '22' }
)
assert_routing(
{ :method => 'post', :path => "/time_entries" },
{ :controller => 'timelog', :action => 'create' }
)
assert_routing(
{ :method => 'put', :path => "/time_entries/22" },
{ :controller => 'timelog', :action => 'update', :id => '22' }
)
assert_routing(
{ :method => 'delete', :path => "/time_entries/55" },
{ :controller => 'timelog', :action => 'destroy', :id => '55' }
)
end
context "timelogs (scoped under project)" do