summaryrefslogtreecommitdiff
path: root/spec/services
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2016-05-15 10:46:54 -0500
committerKamil Trzcinski <ayufan@ayufan.eu>2016-05-15 10:47:04 -0500
commit28ed9907047dd07089833d5b7bb8cd800e0ddff6 (patch)
tree425ddf204426d0bff9338be9ee71629543cf7892 /spec/services
parentdfd0e2450aabc3b5c322c4a4382edb84caa7101b (diff)
downloadgitlab-ce-28ed9907047dd07089833d5b7bb8cd800e0ddff6.tar.gz
Fix http status codes for container registry authentication service
Diffstat (limited to 'spec/services')
-rw-r--r--spec/services/auth/container_registry_authentication_service_spec.rb17
1 files changed, 6 insertions, 11 deletions
diff --git a/spec/services/auth/container_registry_authentication_service_spec.rb b/spec/services/auth/container_registry_authentication_service_spec.rb
index 4a6cd132e8d..3ea252ed44f 100644
--- a/spec/services/auth/container_registry_authentication_service_spec.rb
+++ b/spec/services/auth/container_registry_authentication_service_spec.rb
@@ -57,11 +57,6 @@ describe Auth::ContainerRegistryAuthenticationService, services: true do
end
end
- shared_examples 'a 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 +111,7 @@ describe Auth::ContainerRegistryAuthenticationService, services: true do
{ scope: "repository:#{project.path_with_namespace}:pull,push" }
end
- it_behaves_like 'a unauthorized'
+ it_behaves_like 'a forbidden'
end
end
@@ -154,7 +149,7 @@ describe Auth::ContainerRegistryAuthenticationService, services: true do
context 'disallow for private' do
let(:project) { create(:empty_project, :private) }
- it_behaves_like 'a unauthorized'
+ it_behaves_like 'a forbidden'
end
end
@@ -165,7 +160,7 @@ describe Auth::ContainerRegistryAuthenticationService, services: true do
context 'disallow for all' do
let(:project) { create(:empty_project, :public) }
- it_behaves_like 'a unauthorized'
+ it_behaves_like 'a forbidden'
end
end
end
@@ -185,7 +180,7 @@ describe Auth::ContainerRegistryAuthenticationService, services: true do
{ scope: 'invalid:aa:bb' }
end
- it_behaves_like 'a unauthorized'
+ it_behaves_like 'a forbidden'
end
context 'for private project' do
@@ -195,7 +190,7 @@ describe Auth::ContainerRegistryAuthenticationService, services: true do
{ scope: "repository:#{project.path_with_namespace}:pull" }
end
- it_behaves_like 'a unauthorized'
+ it_behaves_like 'a forbidden'
end
context 'for public project' do
@@ -214,7 +209,7 @@ describe Auth::ContainerRegistryAuthenticationService, services: true do
{ scope: "repository:#{project.path_with_namespace}:push" }
end
- it_behaves_like 'a unauthorized'
+ it_behaves_like 'a forbidden'
end
end
end