debian-mirror-gitlab/spec/factories/packages/debian/distribution.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

38 lines
1 KiB
Ruby
Raw Normal View History

2021-03-08 18:12:59 +05:30
# frozen_string_literal: true
FactoryBot.define do
factory :debian_project_distribution, class: 'Packages::Debian::ProjectDistribution' do
container { association(:project) }
2023-07-09 08:55:56 +05:30
sequence(:codename) { |n| "codename-#{n}" }
2021-03-08 18:12:59 +05:30
factory :debian_group_distribution, class: 'Packages::Debian::GroupDistribution' do
container { association(:group) }
2023-04-23 21:23:45 +05:30
end
2021-03-08 18:12:59 +05:30
2023-04-23 21:23:45 +05:30
trait(:with_suite) do
2023-07-09 08:55:56 +05:30
sequence(:suite) { |n| "suite-#{n}" }
2021-03-08 18:12:59 +05:30
end
trait(:with_file) do
2021-10-27 15:23:28 +05:30
file_signature do
2023-04-23 21:23:45 +05:30
<<~FILESIGNATURE
2021-10-27 15:23:28 +05:30
-----BEGIN PGP SIGNATURE-----
ABC
-----BEGIN PGP SIGNATURE-----
2023-04-23 21:23:45 +05:30
FILESIGNATURE
2021-10-27 15:23:28 +05:30
end
2023-07-09 08:55:56 +05:30
after(:build) do |distribution, _evaluator|
2021-03-11 19:13:27 +05:30
distribution.file = fixture_file_upload('spec/fixtures/packages/debian/distribution/Release')
2021-10-27 15:23:28 +05:30
distribution.signed_file = fixture_file_upload('spec/fixtures/packages/debian/distribution/InRelease')
2021-03-08 18:12:59 +05:30
end
end
trait(:object_storage) do
file_store { Packages::PackageFileUploader::Store::REMOTE }
end
end
end