summaryrefslogtreecommitdiffstats
path: root/test/integration
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2017-01-04 19:52:47 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2017-01-04 19:52:47 +0000
commit82a67f4ebe5ac133bede65b7366d5ea31b05f8dc (patch)
treed7291226f5ff0baafb3d9ac82244eac0fc7e790e /test/integration
parent7ec2c2738593c8535c80f85def82b8b680217848 (diff)
downloadredmine-82a67f4ebe5ac133bede65b7366d5ea31b05f8dc.tar.gz
redmine-82a67f4ebe5ac133bede65b7366d5ea31b05f8dc.zip
Merged r16114 (#24646).
git-svn-id: http://svn.redmine.org/redmine/branches/3.3-stable@16130 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/integration')
-rw-r--r--test/integration/attachments_test.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/integration/attachments_test.rb b/test/integration/attachments_test.rb
index 114e47a3a..ec7626953 100644
--- a/test/integration/attachments_test.rb
+++ b/test/integration/attachments_test.rb
@@ -136,6 +136,18 @@ class AttachmentsTest < Redmine::IntegrationTest
assert_include "$('#attachments_1').remove();", response.body
end
+ def test_download_should_set_sendfile_header
+ set_fixtures_attachments_directory
+ Rack::Sendfile.any_instance.stubs(:variation).returns("X-Sendfile")
+
+ get "/attachments/download/4"
+ assert_response :success
+ assert_not_nil response.headers["X-Sendfile"]
+
+ ensure
+ set_tmp_attachments_directory
+ end
+
private
def ajax_upload(filename, content, attachment_id=1)