Welcome to mirror list, hosted at ThFree Co, Russian Federation.

dependency_proxy.rb « factories « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 33356a701dffde9d977ff0c2aad2981d2077d861 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# frozen_string_literal: true

FactoryBot.define do
  factory :dependency_proxy_blob, class: 'DependencyProxy::Blob' do
    group
    size { 1234 }
    file_name { 'a3ed95caeb02ffe68cdd9fd84406680ae93d633cb16422d00e8a7c22955b46d4.gz' }
    status { :default }

    after(:build) do |blob, _evaluator|
      blob.file = fixture_file_upload('spec/fixtures/dependency_proxy/a3ed95caeb02ffe68cdd9fd84406680ae93d633cb16422d00e8a7c22955b46d4.gz')
    end

    trait :pending_destruction do
      status { :pending_destruction }
    end

    trait :remote_store do
      file_store { DependencyProxy::FileUploader::Store::REMOTE }
    end
  end

  factory :dependency_proxy_manifest, class: 'DependencyProxy::Manifest' do
    group
    size { 1234 }
    file { fixture_file_upload('spec/fixtures/dependency_proxy/manifest') }
    digest { 'sha256:d0710affa17fad5f466a70159cc458227bd25d4afb39514ef662ead3e6c99515' }
    sequence(:file_name) { |n| "alpine:latest#{n}.json" }
    content_type { 'application/vnd.docker.distribution.manifest.v2+json' }
    status { :default }

    trait :pending_destruction do
      status { :pending_destruction }
    end
  end
end