summaryrefslogtreecommitdiff
path: root/spec/factories
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-03-31 11:54:09 +0200
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-03-31 11:54:09 +0200
commita7466af3a6f31311d64654631a2ea2740c42b88e (patch)
tree7eb1d3f63a73cc2d4cca13ba3640d16c7e654b98 /spec/factories
parent600bbe15a103b63e14daa295abaffdf1aeafaef3 (diff)
downloadgitlab-ce-a7466af3a6f31311d64654631a2ea2740c42b88e.tar.gz
Improve code related to removing container image tags
Diffstat (limited to 'spec/factories')
-rw-r--r--spec/factories/container_repositories.rb20
1 files changed, 14 insertions, 6 deletions
diff --git a/spec/factories/container_repositories.rb b/spec/factories/container_repositories.rb
index 295b3596ee9..4919a03cdf2 100644
--- a/spec/factories/container_repositories.rb
+++ b/spec/factories/container_repositories.rb
@@ -8,13 +8,21 @@ FactoryGirl.define do
end
after(:build) do |repository, evaluator|
- if evaluator.tags.any?
+ next if evaluator.tags.to_a.none?
+
+ allow(repository.client)
+ .to receive(:repository_tags)
+ .and_return({
+ 'name' => repository.path,
+ 'tags' => evaluator.tags
+ })
+
+ evaluator.tags.each do |tag|
allow(repository.client)
- .to receive(:repository_tags)
- .and_return({
- name: repository.path,
- tags: evaluator.tags
- })
+ .to receive(:repository_tag_digest)
+ .with(repository.path, tag)
+ .and_return('sha256:4c8e63ca4cb663ce6c688cb06f1c3' \
+ '72b088dac5b6d7ad7d49cd620d85cf72a15')
end
end
end