diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-19 11:27:35 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-19 11:27:35 +0300 |
commit | 7e9c479f7de77702622631cff2628a9c8dcbc627 (patch) | |
tree | c8f718a08e110ad7e1894510980d2155a6549197 /spec/controllers/concerns/send_file_upload_spec.rb | |
parent | e852b0ae16db4052c1c567d9efa4facc81146e88 (diff) |
Add latest changes from gitlab-org/gitlab@13-6-stable-eev13.6.0-rc42
Diffstat (limited to 'spec/controllers/concerns/send_file_upload_spec.rb')
-rw-r--r-- | spec/controllers/concerns/send_file_upload_spec.rb | 55 |
1 files changed, 6 insertions, 49 deletions
diff --git a/spec/controllers/concerns/send_file_upload_spec.rb b/spec/controllers/concerns/send_file_upload_spec.rb index 747ccd7ba1b..f9a6afb95ea 100644 --- a/spec/controllers/concerns/send_file_upload_spec.rb +++ b/spec/controllers/concerns/send_file_upload_spec.rb @@ -70,61 +70,18 @@ RSpec.describe SendFileUpload do allow(uploader).to receive(:model).and_return(image_owner) end - context 'when boths FFs are enabled' do - before do - stub_feature_flags(dynamic_image_resizing_requester: image_requester) - stub_feature_flags(dynamic_image_resizing_owner: image_owner) - end - - it_behaves_like 'handles image resize requests allowed by FFs' - end - - context 'when boths FFs are enabled globally' do - before do - stub_feature_flags(dynamic_image_resizing_requester: true) - stub_feature_flags(dynamic_image_resizing_owner: true) - end - - it_behaves_like 'handles image resize requests allowed by FFs' - - context 'when current_user is nil' do - before do - allow(controller).to receive(:current_user).and_return(nil) - end - - it_behaves_like 'handles image resize requests allowed by FFs' - end - end - - context 'when only FF based on content requester is enabled for current user' do - before do - stub_feature_flags(dynamic_image_resizing_requester: image_requester) - stub_feature_flags(dynamic_image_resizing_owner: false) - end - - it_behaves_like 'bypasses image resize requests not allowed by FFs' - end - - context 'when only FF based on content owner is enabled for requested avatar owner' do - before do - stub_feature_flags(dynamic_image_resizing_requester: false) - stub_feature_flags(dynamic_image_resizing_owner: image_owner) - end - - it_behaves_like 'bypasses image resize requests not allowed by FFs' - end + it_behaves_like 'handles image resize requests allowed by FF' - context 'when both FFs are disabled' do + context 'when FF is disabled' do before do - stub_feature_flags(dynamic_image_resizing_requester: false) - stub_feature_flags(dynamic_image_resizing_owner: false) + stub_feature_flags(dynamic_image_resizing: false) end - it_behaves_like 'bypasses image resize requests not allowed by FFs' + it_behaves_like 'bypasses image resize requests not allowed by FF' end end - shared_examples 'bypasses image resize requests not allowed by FFs' do + shared_examples 'bypasses image resize requests not allowed by FF' do it 'does not write workhorse command header' do expect(headers).not_to receive(:store).with(Gitlab::Workhorse::SEND_DATA_HEADER, /^send-scaled-img:/) @@ -132,7 +89,7 @@ RSpec.describe SendFileUpload do end end - shared_examples 'handles image resize requests allowed by FFs' do + shared_examples 'handles image resize requests allowed by FF' do context 'with valid width parameter' do it 'renders OK with workhorse command header' do expect(controller).not_to receive(:send_file) |