summaryrefslogtreecommitdiff
path: root/spec/factories/container_images.rb
blob: 6141a519a7588a542d8e7b2feea04f51461009d6 (plain)
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