]> source.dussan.org Git - redmine.git/commitdiff
test: replace "should_route" of "issues" form update to "assert_routing" at integrati...
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Thu, 15 Dec 2011 08:12:42 +0000 (08:12 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Thu, 15 Dec 2011 08:12:42 +0000 (08:12 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8222 e93f8b46-1217-0410-a6f0-8f06a7374b81

test/integration/routing_test.rb

index 01e858a67b7d4e3cb4063b1772867f4d15720c1a..e6ccfaca18c88b6be6df2f753c80af55e28d1700 100644 (file)
@@ -240,17 +240,36 @@ class RoutingTest < ActionController::IntegrationTest
       )
   end
 
-  context "issues" do
-    # issue form update
-    should_route :post, "/projects/23/issues/new", :controller => 'issues', :action => 'new', :project_id => '23'
-    should_route :post, "/projects/23/issues", :controller => 'issues', :action => 'create', :project_id => '23'
-    should_route :post, "/issues.xml", :controller => 'issues', :action => 'create', :format => 'xml'
-
-    should_route :get, "/issues/64/edit", :controller => 'issues', :action => 'edit', :id => '64'
-    should_route :put, "/issues/1.xml", :controller => 'issues', :action => 'update', :id => '1', :format => 'xml'
-
-    should_route :delete, "/issues/1.xml", :controller => 'issues', :action => 'destroy', :id => '1', :format => 'xml'
+  def test_issues_form_update
+    assert_routing(
+        { :method => 'post', :path => "/projects/23/issues/new" },
+        { :controller => 'issues', :action => 'new', :project_id => '23' }
+      )
+    assert_routing(
+        { :method => 'post', :path => "/projects/23/issues" },
+        { :controller => 'issues', :action => 'create', :project_id => '23' }
+      )
+    assert_routing(
+        { :method => 'post', :path => "/issues.xml" },
+        { :controller => 'issues', :action => 'create', :format => 'xml' }
+      )
+    assert_routing(
+        { :method => 'get', :path => "/issues/64/edit" },
+        { :controller => 'issues', :action => 'edit', :id => '64' }
+      )
+    assert_routing(
+        { :method => 'put', :path => "/issues/1.xml" },
+        { :controller => 'issues', :action => 'update', :id => '1',
+          :format => 'xml' }
+      )
+    assert_routing(
+        { :method => 'delete', :path => "/issues/1.xml" },
+        { :controller => 'issues', :action => 'destroy', :id => '1',
+          :format => 'xml' }
+      )
+  end
 
+  context "issues" do
     # Extra actions
     should_route :get, "/projects/23/issues/64/copy", :controller => 'issues', :action => 'new', :project_id => '23', :copy_from => '64'