summaryrefslogtreecommitdiff
path: root/spec/services
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-03-31 12:37:44 +0200
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-03-31 12:37:44 +0200
commit4726ff9dbee74d00544c7eb1ea188ecdfe16d7e8 (patch)
treece46eb404c49cf78ab69fb66f437a54b7eb2a2ce /spec/services
parent60cdd2bcc894cf9cce4892570bf6a146dc45e536 (diff)
downloadgitlab-ce-4726ff9dbee74d00544c7eb1ea188ecdfe16d7e8.tar.gz
Add test example for invalid registry access request
Diffstat (limited to 'spec/services')
-rw-r--r--spec/services/auth/container_registry_authentication_service_spec.rb13
1 files changed, 11 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 a4a6430011e..e273dfe1552 100644
--- a/spec/services/auth/container_registry_authentication_service_spec.rb
+++ b/spec/services/auth/container_registry_authentication_service_spec.rb
@@ -81,13 +81,13 @@ describe Auth::ContainerRegistryAuthenticationService, services: true do
end
shared_examples 'container repository factory' do
- it 'creates a new containe repository resource' do
+ it 'creates a new container repository resource' do
expect { subject }
.to change { project.container_repositories.count }.by(1)
end
end
- shared_examples 'container repository factory' do
+ shared_examples 'not a container repository factory' do
it 'does not create a new container repository resource' do
expect { subject }.not_to change { ContainerRepository.count }
end
@@ -183,6 +183,15 @@ describe Auth::ContainerRegistryAuthenticationService, services: true do
it_behaves_like 'an inaccessible'
it_behaves_like 'not a container repository factory'
end
+
+ context 'when repository name is invalid' do
+ let(:current_params) do
+ { scope: 'repository:invalid:push' }
+ end
+
+ it_behaves_like 'an inaccessible'
+ it_behaves_like 'not a container repository factory'
+ end
end
context 'for internal project' do