From e2de7f2529a161033d877f3a3eaecbf9665a5251 Mon Sep 17 00:00:00 2001 From: Toshi MARUYAMA Date: Fri, 16 Dec 2011 04:01:44 +0000 Subject: [PATCH] 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 --- test/integration/routing_test.rb | 45 +++++++++++++++++++++++--------- 1 file changed, 33 insertions(+), 12 deletions(-) diff --git a/test/integration/routing_test.rb b/test/integration/routing_test.rb index 9558a7f96..d3cae288d 100644 --- a/test/integration/routing_test.rb +++ b/test/integration/routing_test.rb @@ -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