container_images.rb 487 Bytes
Newer Older
Andre Guedes's avatar
Andre Guedes committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
FactoryGirl.define do
  factory :container_image do
    name "test_container_image"
    project

    transient do
      tags ['tag']
      stubbed true
    end

    after(:build) do |image, evaluator|
      if evaluator.stubbed
        allow(Gitlab.config.registry).to receive(:enabled).and_return(true)
        allow(image.client).to receive(:repository_tags).and_return({
          name: image.name_with_namespace,
          tags: evaluator.tags
        })
      end
    end
  end
end