diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-10-20 11:43:02 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-10-20 11:43:02 +0300 |
commit | d9ab72d6080f594d0b3cae15f14b3ef2c6c638cb (patch) | |
tree | 2341ef426af70ad1e289c38036737e04b0aa5007 /spec/requests/api/container_repositories_spec.rb | |
parent | d6e514dd13db8947884cd58fe2a9c2a063400a9b (diff) |
Add latest changes from gitlab-org/gitlab@14-4-stable-eev14.4.0-rc42
Diffstat (limited to 'spec/requests/api/container_repositories_spec.rb')
-rw-r--r-- | spec/requests/api/container_repositories_spec.rb | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/spec/requests/api/container_repositories_spec.rb b/spec/requests/api/container_repositories_spec.rb index 8d7494ffce1..9809702467d 100644 --- a/spec/requests/api/container_repositories_spec.rb +++ b/spec/requests/api/container_repositories_spec.rb @@ -48,6 +48,19 @@ RSpec.describe API::ContainerRepositories do expect(response).to match_response_schema('registry/repository') end + context 'with a network error' do + before do + stub_container_registry_network_error(client_method: :repository_tags) + end + + it 'returns a matching schema' do + subject + + expect(response).to have_gitlab_http_status(:ok) + expect(response).to match_response_schema('registry/repository') + end + end + context 'with tags param' do let(:url) { "/registry/repositories/#{repository.id}?tags=true" } @@ -61,6 +74,19 @@ RSpec.describe API::ContainerRepositories do expect(json_response['id']).to eq(repository.id) expect(response.body).to include('tags') end + + context 'with a network error' do + before do + stub_container_registry_network_error(client_method: :repository_tags) + end + + it 'returns a connection error message' do + subject + + expect(response).to have_gitlab_http_status(:service_unavailable) + expect(json_response['message']).to include('We are having trouble connecting to the Container Registry') + end + end end context 'with tags_count param' do |