2021-03-11 19:13:27 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
FactoryBot.define do
|
|
|
|
factory :debian_project_component_file, class: 'Packages::Debian::ProjectComponentFile' do
|
2021-09-04 01:27:46 +05:30
|
|
|
transient do
|
|
|
|
file_fixture { 'spec/fixtures/packages/debian/distribution/Packages' }
|
|
|
|
end
|
|
|
|
|
2021-03-11 19:13:27 +05:30
|
|
|
component { association(:debian_project_component) }
|
|
|
|
architecture { association(:debian_project_architecture, distribution: component.distribution) }
|
|
|
|
|
|
|
|
factory :debian_group_component_file, class: 'Packages::Debian::GroupComponentFile' do
|
|
|
|
component { association(:debian_group_component) }
|
|
|
|
architecture { association(:debian_group_architecture, distribution: component.distribution) }
|
|
|
|
end
|
|
|
|
|
|
|
|
file_type { :packages }
|
|
|
|
|
|
|
|
after(:build) do |component_file, evaluator|
|
2021-09-04 01:27:46 +05:30
|
|
|
component_file.file = fixture_file_upload(evaluator.file_fixture) if evaluator.file_fixture.present?
|
2021-03-11 19:13:27 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
file_md5 { '12345abcde' }
|
|
|
|
file_sha256 { 'be93151dc23ac34a82752444556fe79b32c7a1ad' }
|
|
|
|
|
|
|
|
trait(:packages) do
|
|
|
|
file_type { :packages }
|
|
|
|
end
|
|
|
|
|
2022-01-26 12:08:38 +05:30
|
|
|
trait(:sources) do
|
|
|
|
file_type { :sources }
|
2021-03-11 19:13:27 +05:30
|
|
|
architecture { nil }
|
2022-10-11 01:57:18 +05:30
|
|
|
file_fixture { 'spec/fixtures/packages/debian/distribution/Sources' }
|
2021-03-11 19:13:27 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
trait(:di_packages) do
|
|
|
|
file_type { :di_packages }
|
2022-10-11 01:57:18 +05:30
|
|
|
file_fixture { 'spec/fixtures/packages/debian/distribution/D-I-Packages' }
|
|
|
|
end
|
|
|
|
|
|
|
|
trait(:older_sha256) do
|
|
|
|
created_at { '2020-01-24T08:00:00Z' }
|
|
|
|
file_sha256 { '157a1ad2b9102038560eea56771913b312ebf25093f5ef3b9842021c639c880d' }
|
|
|
|
file_fixture { 'spec/fixtures/packages/debian/distribution/OtherSHA256' }
|
2021-03-11 19:13:27 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
trait(:object_storage) do
|
|
|
|
file_store { Packages::PackageFileUploader::Store::REMOTE }
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|