summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorDouglas Barbosa Alexandre <dbalexandre@gmail.com>2019-08-01 20:15:51 +0000
committerDouglas Barbosa Alexandre <dbalexandre@gmail.com>2019-08-01 20:15:51 +0000
commitb2dd581be375e4f21af9d2c487528ffd06508618 (patch)
tree95c3be4f5fe1dd078b84a3ab81db2ff90c211f86 /spec
parentcbe51cce7a5676a0c8808218cf12754c9e1d5e53 (diff)
parentf519a4b72f81a1e3c81e5e684d236bbe30e0dd2d (diff)
downloadgitlab-ce-b2dd581be375e4f21af9d2c487528ffd06508618.tar.gz
Merge branch 'ce-docker_image_replication' into 'master'
Backport of https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/3809 See merge request gitlab-org/gitlab-ce!31375
Diffstat (limited to 'spec')
-rw-r--r--spec/factories/container_repositories.rb2
-rw-r--r--spec/services/auth/container_registry_authentication_service_spec.rb13
2 files changed, 14 insertions, 1 deletions
diff --git a/spec/factories/container_repositories.rb b/spec/factories/container_repositories.rb
index a9771200d6e..0b756220d68 100644
--- a/spec/factories/container_repositories.rb
+++ b/spec/factories/container_repositories.rb
@@ -2,7 +2,7 @@
FactoryBot.define do
factory :container_repository do
- name 'test_image'
+ sequence(:name) { |n| "test_image_#{n}" }
project
transient do
diff --git a/spec/services/auth/container_registry_authentication_service_spec.rb b/spec/services/auth/container_registry_authentication_service_spec.rb
index 4f4776bbb27..3ca389ba25b 100644
--- a/spec/services/auth/container_registry_authentication_service_spec.rb
+++ b/spec/services/auth/container_registry_authentication_service_spec.rb
@@ -145,6 +145,19 @@ describe Auth::ContainerRegistryAuthenticationService do
it_behaves_like 'not a container repository factory'
end
+ describe '#pull_access_token' do
+ let(:project) { create(:project) }
+ let(:token) { described_class.pull_access_token(project.full_path) }
+
+ subject { { token: token } }
+
+ it_behaves_like 'an accessible' do
+ let(:actions) { ['pull'] }
+ end
+
+ it_behaves_like 'not a container repository factory'
+ end
+
context 'user authorization' do
let(:current_user) { create(:user) }