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/support/shared_examples/requests/api/container_repositories_shared_examples.rb | |
parent | a1761f15ec2cae7c7f7bbda39a75494add0dfd6f (diff) |
Add latest changes from gitlab-org/gitlab@15-0-stable-eev15.0.0-rc42
Diffstat (limited to 'spec/support/shared_examples/requests/api/container_repositories_shared_examples.rb')
-rw-r--r-- | spec/support/shared_examples/requests/api/container_repositories_shared_examples.rb | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/spec/support/shared_examples/requests/api/container_repositories_shared_examples.rb b/spec/support/shared_examples/requests/api/container_repositories_shared_examples.rb index c1eccafa987..f5c41416763 100644 --- a/spec/support/shared_examples/requests/api/container_repositories_shared_examples.rb +++ b/spec/support/shared_examples/requests/api/container_repositories_shared_examples.rb @@ -21,6 +21,7 @@ RSpec.shared_examples 'returns repositories for allowed users' do |user_type, sc expect(json_response.map { |repository| repository['id'] }).to contain_exactly( root_repository.id, test_repository.id) expect(response.body).not_to include('tags') + expect(response.body).not_to include('tags_count') end it 'returns a matching schema' do @@ -29,7 +30,11 @@ RSpec.shared_examples 'returns repositories for allowed users' do |user_type, sc expect(response).to have_gitlab_http_status(:ok) expect(response).to match_response_schema('registry/repositories') end + end +end +RSpec.shared_examples 'returns tags for allowed users' do |user_type, scope| + context "for #{user_type}" do context 'with tags param' do let(:url) { "/#{scope}s/#{object.id}/registry/repositories?tags=true" } @@ -169,10 +174,12 @@ RSpec.shared_examples 'reconciling migration_state' do end end - context 'import_failed response' do - let(:status) { 'import_failed' } + %w[import_canceled import_failed].each do |status| + context "#{status} response" do + let(:status) { status } - it_behaves_like 'retrying the import' + it_behaves_like 'retrying the import' + end end context 'pre_import_in_progress response' do @@ -192,17 +199,11 @@ RSpec.shared_examples 'reconciling migration_state' do end end - context 'pre_import_failed response' do - let(:status) { 'pre_import_failed' } - - it_behaves_like 'retrying the pre_import' - end - - %w[pre_import_canceled import_canceled].each do |canceled_status| - context "#{canceled_status} response" do - let(:status) { canceled_status } + %w[pre_import_canceled pre_import_failed].each do |status| + context "#{status} response" do + let(:status) { status } - it_behaves_like 'enforcing states coherence to', 'import_skipped' + it_behaves_like 'retrying the pre_import' end end end |