summaryrefslogtreecommitdiff
path: root/spec/controllers/concerns/send_file_upload_spec.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-01-29 18:08:47 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-01-29 18:08:47 +0000
commit6b9d3a4e8351e662c4586b24bb152de78ae9e3bf (patch)
tree883e9db60c047c54418fc1d2b1c5517f97e0f185 /spec/controllers/concerns/send_file_upload_spec.rb
parent23288f62da73fb0e30d8e7ce306665e8fda1b932 (diff)
downloadgitlab-ce-6b9d3a4e8351e662c4586b24bb152de78ae9e3bf.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/controllers/concerns/send_file_upload_spec.rb')
-rw-r--r--spec/controllers/concerns/send_file_upload_spec.rb24
1 files changed, 2 insertions, 22 deletions
diff --git a/spec/controllers/concerns/send_file_upload_spec.rb b/spec/controllers/concerns/send_file_upload_spec.rb
index 4110be721ad..3cfb7b5a488 100644
--- a/spec/controllers/concerns/send_file_upload_spec.rb
+++ b/spec/controllers/concerns/send_file_upload_spec.rb
@@ -59,11 +59,9 @@ describe SendFileUpload do
let(:params) { { disposition: 'inline', attachment: filename } }
it 'sends a file with inline disposition' do
- # Notice the filename= is omitted from the disposition; this is because
- # Rails 5 will append this header in send_file
expected_params = {
filename: 'test.png',
- disposition: "inline; filename*=UTF-8''test.png"
+ disposition: 'inline'
}
expect(controller).to receive(:send_file).with(uploader.path, expected_params)
@@ -76,34 +74,16 @@ describe SendFileUpload do
let(:params) { { attachment: filename } }
it 'sends a file with content-type of text/plain' do
- # Notice the filename= is omitted from the disposition; this is because
- # Rails 5 will append this header in send_file
expected_params = {
content_type: 'text/plain',
filename: 'test.js',
- disposition: "attachment; filename*=UTF-8''test.js"
+ disposition: 'attachment'
}
expect(controller).to receive(:send_file).with(uploader.path, expected_params)
subject
end
- context 'with non-ASCII encoded filename' do
- let(:filename) { 'ใƒ†ใ‚นใƒˆ.txt' }
-
- # Notice the filename= is omitted from the disposition; this is because
- # Rails 5 will append this header in send_file
- it 'sends content-disposition for non-ASCII encoded filenames' do
- expected_params = {
- filename: filename,
- disposition: "attachment; filename*=UTF-8''%E3%83%86%E3%82%B9%E3%83%88.txt"
- }
- expect(controller).to receive(:send_file).with(uploader.path, expected_params)
-
- subject
- end
- end
-
context 'with a proxied file in object storage' do
before do
stub_uploads_object_storage(uploader: uploader_class)