diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-10-11 18:09:46 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-10-11 18:09:46 +0000 |
commit | 5da842297dfad0ce52724aa4fd7f19b1307b7a11 (patch) | |
tree | 24f5a79281ea348ac0a43e462f84d4216b7c60c8 /spec/controllers/projects/registry/repositories_controller_spec.rb | |
parent | 046d6f52772ada2e08af58627f03bc18e0c932b5 (diff) | |
download | gitlab-ce-5da842297dfad0ce52724aa4fd7f19b1307b7a11.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/controllers/projects/registry/repositories_controller_spec.rb')
-rw-r--r-- | spec/controllers/projects/registry/repositories_controller_spec.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/controllers/projects/registry/repositories_controller_spec.rb b/spec/controllers/projects/registry/repositories_controller_spec.rb index 0685e5a2055..a5faaaf5969 100644 --- a/spec/controllers/projects/registry/repositories_controller_spec.rb +++ b/spec/controllers/projects/registry/repositories_controller_spec.rb @@ -9,6 +9,7 @@ RSpec.describe Projects::Registry::RepositoriesController do before do sign_in(user) stub_container_registry_config(enabled: true) + stub_container_registry_info end context 'when user has access to registry' do @@ -30,6 +31,18 @@ RSpec.describe Projects::Registry::RepositoriesController do expect(response).to have_gitlab_http_status(:not_found) end + + [ContainerRegistry::Path::InvalidRegistryPathError, Faraday::Error].each do |error_class| + context "when there is a #{error_class}" do + it 'displays a connection error message' do + expect(::ContainerRegistry::Client).to receive(:registry_info).and_raise(error_class, nil, nil) + + go_to_index + + expect(response).to have_gitlab_http_status(:ok) + end + end + end end shared_examples 'renders a list of repositories' do |