]> source.dussan.org Git - redmine.git/commitdiff
test: replace "should_route" of "timelogs (scoped under project)" to "assert_routing...
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Fri, 16 Dec 2011 08:10:17 +0000 (08:10 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Fri, 16 Dec 2011 08:10:17 +0000 (08:10 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8244 e93f8b46-1217-0410-a6f0-8f06a7374b81

test/integration/routing_test.rb

index e7cada84164714cd10dcd900c2319640d84ecb9b..2f582f3b1fb88eca4417a1020842b3876c0f6d7e 100644 (file)
@@ -555,18 +555,45 @@ class RoutingTest < ActionController::IntegrationTest
       )
   end
 
-  context "timelogs (scoped under project)" do
-    should_route :get, "/projects/567/time_entries", :controller => 'timelog', :action => 'index', :project_id => '567'
-    should_route :get, "/projects/567/time_entries.csv", :controller => 'timelog', :action => 'index', :project_id => '567', :format => 'csv'
-    should_route :get, "/projects/567/time_entries.atom", :controller => 'timelog', :action => 'index', :project_id => '567', :format => 'atom'
-    should_route :get, "/projects/567/time_entries/new", :controller => 'timelog', :action => 'new', :project_id => '567'
-    should_route :get, "/projects/567/time_entries/22/edit", :controller => 'timelog', :action => 'edit', :id => '22', :project_id => '567'
-
-    should_route :post, "/projects/567/time_entries", :controller => 'timelog', :action => 'create', :project_id => '567'
-
-    should_route :put, "/projects/567/time_entries/22", :controller => 'timelog', :action => 'update', :id => '22', :project_id => '567'
-
-    should_route :delete, "/projects/567/time_entries/55", :controller => 'timelog', :action => 'destroy', :id => '55', :project_id => '567'
+  def test_timelogs_scoped_under_project
+    assert_routing(
+        { :method => 'get', :path => "/projects/567/time_entries" },
+        { :controller => 'timelog', :action => 'index', :project_id => '567' }
+      )
+    assert_routing(
+        { :method => 'get', :path => "/projects/567/time_entries.csv" },
+        { :controller => 'timelog', :action => 'index', :project_id => '567',
+          :format => 'csv' }
+      )
+    assert_routing(
+        { :method => 'get', :path => "/projects/567/time_entries.atom" },
+        { :controller => 'timelog', :action => 'index', :project_id => '567',
+          :format => 'atom' }
+      )
+    assert_routing(
+        { :method => 'get', :path => "/projects/567/time_entries/new" },
+        { :controller => 'timelog', :action => 'new', :project_id => '567' }
+      )
+    assert_routing(
+        { :method => 'get', :path => "/projects/567/time_entries/22/edit" },
+        { :controller => 'timelog', :action => 'edit',
+          :id => '22', :project_id => '567' }
+      )
+    assert_routing(
+        { :method => 'post', :path => "/projects/567/time_entries" },
+        { :controller => 'timelog', :action => 'create',
+          :project_id => '567' }
+      )
+    assert_routing(
+        { :method => 'put', :path => "/projects/567/time_entries/22" },
+        { :controller => 'timelog', :action => 'update',
+          :id => '22', :project_id => '567' }
+      )
+    assert_routing(
+        { :method => 'delete', :path => "/projects/567/time_entries/55" },
+        { :controller => 'timelog', :action => 'destroy',
+          :id => '55', :project_id => '567' }
+      )
   end
 
   context "timelogs (scoped under issues)" do