]> source.dussan.org Git - redmine.git/commitdiff
test: replace "should_route" of "attachments" to "assert_routing" at integration...
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Wed, 14 Dec 2011 10:07:31 +0000 (10:07 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Wed, 14 Dec 2011 10:07:31 +0000 (10:07 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8202 e93f8b46-1217-0410-a6f0-8f06a7374b81

test/integration/routing_test.rb

index a8fc2cdab03b3bc5d5b2741b831617c0f2dab5ad..536cec89e9e2157800441b20515b0e6e85c4e115 100644 (file)
@@ -29,13 +29,33 @@ class RoutingTest < ActionController::IntegrationTest
         )
   end
 
-  context "attachments" do
-    should_route :get, "/attachments/1", :controller => 'attachments', :action => 'show', :id => '1'
-    should_route :get, "/attachments/1.xml", :controller => 'attachments', :action => 'show', :id => '1', :format => 'xml'
-    should_route :get, "/attachments/1.json", :controller => 'attachments', :action => 'show', :id => '1', :format => 'json'
-    should_route :get, "/attachments/1/filename.ext", :controller => 'attachments', :action => 'show', :id => '1', :filename => 'filename.ext'
-    should_route :get, "/attachments/download/1", :controller => 'attachments', :action => 'download', :id => '1'
-    should_route :get, "/attachments/download/1/filename.ext", :controller => 'attachments', :action => 'download', :id => '1', :filename => 'filename.ext'
+  def test_attachments
+    assert_routing(
+           { :method => 'get', :path => "/attachments/1" },
+           { :controller => 'attachments', :action => 'show', :id => '1' }
+         )
+    assert_routing(
+           { :method => 'get', :path => "/attachments/1.xml" },
+           { :controller => 'attachments', :action => 'show', :id => '1', :format => 'xml' }
+         )
+    assert_routing(
+           { :method => 'get', :path => "/attachments/1.json" },
+           { :controller => 'attachments', :action => 'show', :id => '1', :format => 'json' }
+         )
+    assert_routing(
+           { :method => 'get', :path => "/attachments/1/filename.ext" },
+           { :controller => 'attachments', :action => 'show', :id => '1',
+             :filename => 'filename.ext' }
+         )
+    assert_routing(
+           { :method => 'get', :path => "/attachments/download/1" },
+           { :controller => 'attachments', :action => 'download', :id => '1' }
+         )
+    assert_routing(
+           { :method => 'get', :path => "/attachments/download/1/filename.ext" },
+           { :controller => 'attachments', :action => 'download', :id => '1',
+             :filename => 'filename.ext' }
+         )
   end
 
   context "boards" do