@@ -29,13 +29,33 class RoutingTest < ActionController::IntegrationTest | |||
|
29 | 29 | ) |
|
30 | 30 | end |
|
31 | 31 | |
|
32 |
|
|
|
33 | should_route :get, "/attachments/1", :controller => 'attachments', :action => 'show', :id => '1' | |
|
34 | should_route :get, "/attachments/1.xml", :controller => 'attachments', :action => 'show', :id => '1', :format => 'xml' | |
|
35 |
|
|
|
36 | should_route :get, "/attachments/1/filename.ext", :controller => 'attachments', :action => 'show', :id => '1', :filename => 'filename.ext' | |
|
37 | should_route :get, "/attachments/download/1", :controller => 'attachments', :action => 'download', :id => '1' | |
|
38 | should_route :get, "/attachments/download/1/filename.ext", :controller => 'attachments', :action => 'download', :id => '1', :filename => 'filename.ext' | |
|
32 | def test_attachments | |
|
33 | assert_routing( | |
|
34 | { :method => 'get', :path => "/attachments/1" }, | |
|
35 | { :controller => 'attachments', :action => 'show', :id => '1' } | |
|
36 | ) | |
|
37 | assert_routing( | |
|
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 | 59 | end |
|
40 | 60 | |
|
41 | 61 | context "boards" do |
General Comments 0
You need to be logged in to leave comments.
Login now