diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-03-24 12:31:34 +0100 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-03-24 12:31:34 +0100 |
commit | af42dd29a0e81d524731f4ce3ced2ed17bac9903 (patch) | |
tree | 83cd561b993830b76155519f676558f387f71dee /spec/factories | |
parent | dcd2eeb1cfb633f4a28ddd9bc79deac0e3171d3f (diff) | |
download | gitlab-ce-af42dd29a0e81d524731f4ce3ced2ed17bac9903.tar.gz |
Fix specs for container repository tags
Diffstat (limited to 'spec/factories')
-rw-r--r-- | spec/factories/container_repositories.rb | 23 |
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 |