summaryrefslogtreecommitdiff
path: root/spec/services/auth
diff options
context:
space:
mode:
Diffstat (limited to 'spec/services/auth')
-rw-r--r--spec/services/auth/container_registry_authentication_service_spec.rb9
1 files changed, 7 insertions, 2 deletions
diff --git a/spec/services/auth/container_registry_authentication_service_spec.rb b/spec/services/auth/container_registry_authentication_service_spec.rb
index d90e2982c4f..6c9f56a4fba 100644
--- a/spec/services/auth/container_registry_authentication_service_spec.rb
+++ b/spec/services/auth/container_registry_authentication_service_spec.rb
@@ -50,6 +50,11 @@ describe Auth::ContainerRegistryAuthenticationService, services: true do
end
end
+ shared_examples 'an unauthorized' do
+ it { is_expected.to include(http_status: 401) }
+ it { is_expected.to_not include(:token) }
+ end
+
shared_examples 'a forbidden' do
it { is_expected.to include(http_status: 403) }
it { is_expected.to_not include(:token) }
@@ -116,7 +121,7 @@ describe Auth::ContainerRegistryAuthenticationService, services: true do
{ offline_token: true }
end
- it_behaves_like 'a forbidden'
+ it_behaves_like 'an unauthorized'
end
context 'allow to pull and push images' do
@@ -179,7 +184,7 @@ describe Auth::ContainerRegistryAuthenticationService, services: true do
{ offline_token: true }
end
- it_behaves_like 'a forbidden'
+ it_behaves_like 'an unauthorized'
end
context 'for invalid scope' do