##// END OF EJS Templates
test: replace "should_route" of "attachments" to "assert_routing" at integration/routing_test.rb...
Toshi MARUYAMA -
r8082:a61d7d053ff3
parent child
Show More
@@ -29,13 +29,33 class RoutingTest < ActionController::IntegrationTest
29 )
29 )
30 end
30 end
31
31
32 context "attachments" do
32 def test_attachments
33 should_route :get, "/attachments/1", :controller => 'attachments', :action => 'show', :id => '1'
33 assert_routing(
34 should_route :get, "/attachments/1.xml", :controller => 'attachments', :action => 'show', :id => '1', :format => 'xml'
34 { :method => 'get', :path => "/attachments/1" },
35 should_route :get, "/attachments/1.json", :controller => 'attachments', :action => 'show', :id => '1', :format => 'json'
35 { :controller => 'attachments', :action => 'show', :id => '1' }
36 should_route :get, "/attachments/1/filename.ext", :controller => 'attachments', :action => 'show', :id => '1', :filename => 'filename.ext'
36 )
37 should_route :get, "/attachments/download/1", :controller => 'attachments', :action => 'download', :id => '1'
37 assert_routing(
38 should_route :get, "/attachments/download/1/filename.ext", :controller => 'attachments', :action => 'download', :id => '1', :filename => 'filename.ext'
38 { :method => 'get', :path => "/attachments/1.xml" },
39 { :controller => 'attachments', :action => 'show', :id => '1', :format => 'xml' }
40 )
41 assert_routing(
42 { :method => 'get', :path => "/attachments/1.json" },
43 { :controller => 'attachments', :action => 'show', :id => '1', :format => 'json' }
44 )
45 assert_routing(
46 { :method => 'get', :path => "/attachments/1/filename.ext" },
47 { :controller => 'attachments', :action => 'show', :id => '1',
48 :filename => 'filename.ext' }
49 )
50 assert_routing(
51 { :method => 'get', :path => "/attachments/download/1" },
52 { :controller => 'attachments', :action => 'download', :id => '1' }
53 )
54 assert_routing(
55 { :method => 'get', :path => "/attachments/download/1/filename.ext" },
56 { :controller => 'attachments', :action => 'download', :id => '1',
57 :filename => 'filename.ext' }
58 )
39 end
59 end
40
60
41 context "boards" do
61 context "boards" do
General Comments 0
You need to be logged in to leave comments. Login now