2021-01-29 00:20:46 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
FactoryBot.define do
|
|
|
|
factory :dependency_proxy_blob, class: 'DependencyProxy::Blob' do
|
|
|
|
group
|
2021-11-11 11:23:49 +05:30
|
|
|
size { 1234 }
|
2021-01-29 00:20:46 +05:30
|
|
|
file_name { 'a3ed95caeb02ffe68cdd9fd84406680ae93d633cb16422d00e8a7c22955b46d4.gz' }
|
2021-11-18 22:05:49 +05:30
|
|
|
status { :default }
|
|
|
|
|
2023-01-13 00:05:48 +05:30
|
|
|
after(:build) do |blob, _evaluator|
|
|
|
|
blob.file = fixture_file_upload('spec/fixtures/dependency_proxy/a3ed95caeb02ffe68cdd9fd84406680ae93d633cb16422d00e8a7c22955b46d4.gz')
|
|
|
|
end
|
|
|
|
|
2022-03-02 08:16:31 +05:30
|
|
|
trait :pending_destruction do
|
|
|
|
status { :pending_destruction }
|
2021-11-18 22:05:49 +05:30
|
|
|
end
|
2023-01-13 00:05:48 +05:30
|
|
|
|
|
|
|
trait :remote_store do
|
|
|
|
file_store { DependencyProxy::FileUploader::Store::REMOTE }
|
|
|
|
end
|
2021-01-29 00:20:46 +05:30
|
|
|
end
|
2021-02-22 17:27:13 +05:30
|
|
|
|
|
|
|
factory :dependency_proxy_manifest, class: 'DependencyProxy::Manifest' do
|
|
|
|
group
|
2021-11-11 11:23:49 +05:30
|
|
|
size { 1234 }
|
2021-04-17 20:07:23 +05:30
|
|
|
digest { 'sha256:d0710affa17fad5f466a70159cc458227bd25d4afb39514ef662ead3e6c99515' }
|
2021-11-18 22:05:49 +05:30
|
|
|
sequence(:file_name) { |n| "alpine:latest#{n}.json" }
|
2021-04-17 20:07:23 +05:30
|
|
|
content_type { 'application/vnd.docker.distribution.manifest.v2+json' }
|
2021-11-18 22:05:49 +05:30
|
|
|
status { :default }
|
|
|
|
|
2023-03-04 22:38:38 +05:30
|
|
|
after(:build) do |manifest, _evaluator|
|
|
|
|
manifest.file = fixture_file_upload('spec/fixtures/dependency_proxy/manifest')
|
|
|
|
end
|
|
|
|
|
2022-03-02 08:16:31 +05:30
|
|
|
trait :pending_destruction do
|
|
|
|
status { :pending_destruction }
|
2021-11-18 22:05:49 +05:30
|
|
|
end
|
2023-03-04 22:38:38 +05:30
|
|
|
|
|
|
|
trait :remote_store do
|
|
|
|
file_store { DependencyProxy::FileUploader::Store::REMOTE }
|
|
|
|
end
|
2021-02-22 17:27:13 +05:30
|
|
|
end
|
2021-01-29 00:20:46 +05:30
|
|
|
end
|