summaryrefslogtreecommitdiff
path: root/spec/factories
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-03-24 12:31:34 +0100
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-03-24 12:31:34 +0100
commitaf42dd29a0e81d524731f4ce3ced2ed17bac9903 (patch)
tree83cd561b993830b76155519f676558f387f71dee /spec/factories
parentdcd2eeb1cfb633f4a28ddd9bc79deac0e3171d3f (diff)
downloadgitlab-ce-af42dd29a0e81d524731f4ce3ced2ed17bac9903.tar.gz
Fix specs for container repository tags
Diffstat (limited to 'spec/factories')
-rw-r--r--spec/factories/container_repositories.rb23
1 files changed, 11 insertions, 12 deletions
diff --git a/spec/factories/container_repositories.rb b/spec/factories/container_repositories.rb
index fbf6bf62dfd..295b3596ee9 100644
--- a/spec/factories/container_repositories.rb
+++ b/spec/factories/container_repositories.rb
@@ -1,22 +1,21 @@
FactoryGirl.define do
factory :container_repository do
- name "test_container_image"
+ name 'test_container_image'
project
transient do
- tags ['tag']
+ tags []
end
- after(:build) do |image, evaluator|
- # if evaluator.tags.to_a.any?
- # allow(Gitlab.config.registry).to receive(:enabled).and_return(true)
- # allow(Auth::ContainerRegistryAuthenticationService)
- # .to receive(:full_access_token).and_return('token')
- # allow(image.client).to receive(:repository_tags).and_return({
- # name: image.name_with_namespace,
- # tags: evaluator.tags
- # })
- # end
+ after(:build) do |repository, evaluator|
+ if evaluator.tags.any?
+ allow(repository.client)
+ .to receive(:repository_tags)
+ .and_return({
+ name: repository.path,
+ tags: evaluator.tags
+ })
+ end
end
end
end