diff options
Diffstat (limited to 'spec/support/shared_examples/features/file_uploads_shared_examples.rb')
-rw-r--r-- | spec/support/shared_examples/features/file_uploads_shared_examples.rb | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/spec/support/shared_examples/features/file_uploads_shared_examples.rb b/spec/support/shared_examples/features/file_uploads_shared_examples.rb new file mode 100644 index 00000000000..ea8c8d44501 --- /dev/null +++ b/spec/support/shared_examples/features/file_uploads_shared_examples.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +RSpec.shared_examples 'handling file uploads' do |shared_examples_name| + context 'with object storage disabled' do + context 'with upload_middleware_jwt_params_handler disabled' do + before do + stub_feature_flags(upload_middleware_jwt_params_handler: false) + + expect_next_instance_of(Gitlab::Middleware::Multipart::Handler) do |handler| + expect(handler).to receive(:with_open_files).and_call_original + end + end + + it_behaves_like shared_examples_name + end + + context 'with upload_middleware_jwt_params_handler enabled' do + before do + stub_feature_flags(upload_middleware_jwt_params_handler: true) + + expect_next_instance_of(Gitlab::Middleware::Multipart::HandlerForJWTParams) do |handler| + expect(handler).to receive(:with_open_files).and_call_original + end + end + + it_behaves_like shared_examples_name + end + end +end |