diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-29 21:08:47 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-29 21:08:47 +0300 |
commit | 6b9d3a4e8351e662c4586b24bb152de78ae9e3bf (patch) | |
tree | 883e9db60c047c54418fc1d2b1c5517f97e0f185 /spec/controllers/concerns | |
parent | 23288f62da73fb0e30d8e7ce306665e8fda1b932 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/controllers/concerns')
-rw-r--r-- | spec/controllers/concerns/metrics_dashboard_spec.rb | 2 | ||||
-rw-r--r-- | spec/controllers/concerns/send_file_upload_spec.rb | 24 |
2 files changed, 3 insertions, 23 deletions
diff --git a/spec/controllers/concerns/metrics_dashboard_spec.rb b/spec/controllers/concerns/metrics_dashboard_spec.rb index 6ab02057412..466021d6ecd 100644 --- a/spec/controllers/concerns/metrics_dashboard_spec.rb +++ b/spec/controllers/concerns/metrics_dashboard_spec.rb @@ -23,7 +23,7 @@ describe MetricsDashboard do routes.draw { get "metrics_dashboard" => "anonymous#metrics_dashboard" } response = get :metrics_dashboard, format: :json - JSON.parse(response.parsed_body) + response.parsed_body end context 'when no parameters are provided' do 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) |