diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-05-19 10:33:21 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-05-19 10:33:21 +0300 |
commit | 36a59d088eca61b834191dacea009677a96c052f (patch) | |
tree | e4f33972dab5d8ef79e3944a9f403035fceea43f /spec/lib/container_registry/client_spec.rb | |
parent | a1761f15ec2cae7c7f7bbda39a75494add0dfd6f (diff) |
Add latest changes from gitlab-org/gitlab@15-0-stable-eev15.0.0-rc42
Diffstat (limited to 'spec/lib/container_registry/client_spec.rb')
-rw-r--r-- | spec/lib/container_registry/client_spec.rb | 53 |
1 files changed, 0 insertions, 53 deletions
diff --git a/spec/lib/container_registry/client_spec.rb b/spec/lib/container_registry/client_spec.rb index 39a594eba5c..f9e08df3399 100644 --- a/spec/lib/container_registry/client_spec.rb +++ b/spec/lib/container_registry/client_spec.rb @@ -199,69 +199,16 @@ RSpec.describe ContainerRegistry::Client do let(:redirect_location) { 'http://redirect?foo=bar&test=signature=' } it_behaves_like 'handling redirects' - - context 'with container_registry_follow_redirects_middleware disabled' do - before do - stub_feature_flags(container_registry_follow_redirects_middleware: false) - end - - it 'follows the redirect' do - expect(Faraday::Utils).to receive(:escape).with('foo').and_call_original - expect(Faraday::Utils).to receive(:escape).with('bar').and_call_original - expect(Faraday::Utils).to receive(:escape).with('test').and_call_original - expect(Faraday::Utils).to receive(:escape).with('signature=').and_call_original - - expect_new_faraday(times: 2) - expect(subject).to eq('Successfully redirected') - end - end end context 'with a redirect location with params ending with %3D' do let(:redirect_location) { 'http://redirect?foo=bar&test=signature%3D' } it_behaves_like 'handling redirects' - - context 'with container_registry_follow_redirects_middleware disabled' do - before do - stub_feature_flags(container_registry_follow_redirects_middleware: false) - end - - it 'follows the redirect' do - expect(Faraday::Utils).to receive(:escape).with('foo').and_call_original - expect(Faraday::Utils).to receive(:escape).with('bar').and_call_original - expect(Faraday::Utils).to receive(:escape).with('test').and_call_original - expect(Faraday::Utils).to receive(:escape).with('signature=').and_call_original - - expect_new_faraday(times: 2) - expect(subject).to eq('Successfully redirected') - end - end end end it_behaves_like 'handling timeouts' - - # TODO Remove this context along with the - # container_registry_follow_redirects_middleware feature flag - # See https://gitlab.com/gitlab-org/gitlab/-/issues/353291 - context 'faraday blob' do - subject { client.send(:faraday_blob) } - - it 'has a follow redirects middleware' do - expect(subject.builder.handlers).to include(::FaradayMiddleware::FollowRedirects) - end - - context 'with container_registry_follow_redirects_middleware is disabled' do - before do - stub_feature_flags(container_registry_follow_redirects_middleware: false) - end - - it 'has not a follow redirects middleware' do - expect(subject.builder.handlers).not_to include(::FaradayMiddleware::FollowRedirects) - end - end - end end describe '#upload_blob' do |