2020-11-05 12:06:23 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
RSpec.shared_examples 'handling file uploads' do |shared_examples_name|
|
|
|
|
context 'with object storage disabled' do
|
2020-11-24 15:15:51 +05:30
|
|
|
context 'with upload_middleware_jwt_params_handler disabled' do
|
|
|
|
before do
|
|
|
|
stub_feature_flags(upload_middleware_jwt_params_handler: false)
|
2020-11-05 12:06:23 +05:30
|
|
|
|
2020-11-24 15:15:51 +05:30
|
|
|
expect_next_instance_of(Gitlab::Middleware::Multipart::Handler) do |handler|
|
|
|
|
expect(handler).to receive(:with_open_files).and_call_original
|
|
|
|
end
|
2020-11-05 12:06:23 +05:30
|
|
|
end
|
2020-11-24 15:15:51 +05:30
|
|
|
|
|
|
|
it_behaves_like shared_examples_name
|
2020-11-05 12:06:23 +05:30
|
|
|
end
|
|
|
|
|
2020-11-24 15:15:51 +05:30
|
|
|
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
|
2020-11-05 12:06:23 +05:30
|
|
|
end
|
|
|
|
end
|