Appends the filename to the attachment url so that clients that ignore content-disposition http header get the real filename (#1649).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1686 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -33,6 +33,21 @@ class AttachmentsControllerTest < Test::Unit::TestCase
|
||||
User.current = nil
|
||||
end
|
||||
|
||||
def test_routing
|
||||
assert_routing('/attachments/1', :controller => 'attachments', :action => 'show', :id => '1')
|
||||
assert_routing('/attachments/1/filename.ext', :controller => 'attachments', :action => 'show', :id => '1', :filename => 'filename.ext')
|
||||
assert_routing('/attachments/download/1', :controller => 'attachments', :action => 'download', :id => '1')
|
||||
assert_routing('/attachments/download/1/filename.ext', :controller => 'attachments', :action => 'download', :id => '1', :filename => 'filename.ext')
|
||||
end
|
||||
|
||||
def test_recognizes
|
||||
assert_recognizes({:controller => 'attachments', :action => 'show', :id => '1'}, '/attachments/1')
|
||||
assert_recognizes({:controller => 'attachments', :action => 'show', :id => '1'}, '/attachments/show/1')
|
||||
assert_recognizes({:controller => 'attachments', :action => 'show', :id => '1', :filename => 'filename.ext'}, '/attachments/1/filename.ext')
|
||||
assert_recognizes({:controller => 'attachments', :action => 'download', :id => '1'}, '/attachments/download/1')
|
||||
assert_recognizes({:controller => 'attachments', :action => 'download', :id => '1', :filename => 'filename.ext'},'/attachments/download/1/filename.ext')
|
||||
end
|
||||
|
||||
def test_show_diff
|
||||
get :show, :id => 5
|
||||
assert_response :success
|
||||
|
||||
Reference in New Issue
Block a user