]> source.dussan.org Git - redmine.git/commitdiff
test: replace "should_route" of "timelogs (global)" to "assert_routing" at integratio...
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Fri, 16 Dec 2011 04:01:44 +0000 (04:01 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Fri, 16 Dec 2011 04:01:44 +0000 (04:01 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8242 e93f8b46-1217-0410-a6f0-8f06a7374b81

test/integration/routing_test.rb

index 9558a7f960e584c0df29b9a7081de121fe020650..d3cae288daf15b16158ac75ce2faaf659e9715c6 100644 (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