mirror of
https://github.com/redmine/redmine.git
synced 2025-11-14 09:16:02 +01:00
Use should_route in routing tests.
git-svn-id: http://svn.redmine.org/redmine/trunk@13608 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -17,37 +17,17 @@
|
||||
|
||||
require File.expand_path('../../../test_helper', __FILE__)
|
||||
|
||||
class RoutingAttachmentsTest < ActionDispatch::IntegrationTest
|
||||
class RoutingAttachmentsTest < Redmine::RoutingTest
|
||||
def test_attachments
|
||||
assert_routing(
|
||||
{ :method => 'get', :path => "/attachments/1" },
|
||||
{ :controller => 'attachments', :action => 'show', :id => '1' }
|
||||
)
|
||||
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' }
|
||||
)
|
||||
assert_routing(
|
||||
{ :method => 'get', :path => "/attachments/thumbnail/1" },
|
||||
{ :controller => 'attachments', :action => 'thumbnail', :id => '1' }
|
||||
)
|
||||
assert_routing(
|
||||
{ :method => 'get', :path => "/attachments/thumbnail/1/200" },
|
||||
{ :controller => 'attachments', :action => 'thumbnail', :id => '1', :size => '200' }
|
||||
)
|
||||
assert_routing(
|
||||
{ :method => 'delete', :path => "/attachments/1" },
|
||||
{ :controller => 'attachments', :action => 'destroy', :id => '1' }
|
||||
)
|
||||
should_route 'GET /attachments/1' => 'attachments#show', :id => '1'
|
||||
should_route 'GET /attachments/1/filename.ext' => 'attachments#show', :id => '1', :filename => 'filename.ext'
|
||||
|
||||
should_route 'GET /attachments/download/1' => 'attachments#download', :id => '1'
|
||||
should_route 'GET /attachments/download/1/filename.ext' => 'attachments#download', :id => '1', :filename => 'filename.ext'
|
||||
|
||||
should_route 'GET /attachments/thumbnail/1' => 'attachments#thumbnail', :id => '1'
|
||||
should_route 'GET /attachments/thumbnail/1/200' => 'attachments#thumbnail', :id => '1', :size => '200'
|
||||
|
||||
should_route 'DELETE /attachments/1' => 'attachments#destroy', :id => '1'
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user