summaryrefslogtreecommitdiff
path: root/spec/controllers/groups/registry
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-10-11 18:09:46 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2021-10-11 18:09:46 +0000
commit5da842297dfad0ce52724aa4fd7f19b1307b7a11 (patch)
tree24f5a79281ea348ac0a43e462f84d4216b7c60c8 /spec/controllers/groups/registry
parent046d6f52772ada2e08af58627f03bc18e0c932b5 (diff)
downloadgitlab-ce-5da842297dfad0ce52724aa4fd7f19b1307b7a11.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/controllers/groups/registry')
-rw-r--r--spec/controllers/groups/registry/repositories_controller_spec.rb25
1 files changed, 25 insertions, 0 deletions
diff --git a/spec/controllers/groups/registry/repositories_controller_spec.rb b/spec/controllers/groups/registry/repositories_controller_spec.rb
index f4541eda293..9ac19b06718 100644
--- a/spec/controllers/groups/registry/repositories_controller_spec.rb
+++ b/spec/controllers/groups/registry/repositories_controller_spec.rb
@@ -19,6 +19,7 @@ RSpec.describe Groups::Registry::RepositoriesController do
before do
stub_container_registry_config(enabled: true)
stub_container_registry_tags(repository: :any, tags: [])
+ stub_container_registry_info
group.add_owner(user)
group.add_guest(guest)
sign_in(user)
@@ -37,6 +38,18 @@ RSpec.describe Groups::Registry::RepositoriesController do
'name' => repo.name
)
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)
+
+ subject
+
+ expect(response).to have_gitlab_http_status(:ok)
+ end
+ end
+ end
end
shared_examples 'with name parameter' do
@@ -71,6 +84,18 @@ RSpec.describe Groups::Registry::RepositoriesController do
expect(response).to have_gitlab_http_status(:ok)
expect_no_snowplow_event
end
+
+ [ContainerRegistry::Path::InvalidRegistryPathError, Faraday::Error].each do |error_class|
+ context "when there is an invalid path error #{error_class}" do
+ it 'displays a connection error message' do
+ expect(::ContainerRegistry::Client).to receive(:registry_info).and_raise(error_class, nil, nil)
+
+ subject
+
+ expect(response).to have_gitlab_http_status(:ok)
+ end
+ end
+ end
end
context 'json format' do