diff options
Diffstat (limited to 'spec/factories/packages.rb')
-rw-r--r-- | spec/factories/packages.rb | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/spec/factories/packages.rb b/spec/factories/packages.rb index 5543be4aa82..31f1aabe5dd 100644 --- a/spec/factories/packages.rb +++ b/spec/factories/packages.rb @@ -26,9 +26,31 @@ FactoryBot.define do sequence(:version) { |n| "1.0-#{n}" } package_type { :debian } + transient do + without_package_files { false } + file_metadatum_trait { :keep } + end + + after :create do |package, evaluator| + unless evaluator.without_package_files + create :debian_package_file, :source, evaluator.file_metadatum_trait, package: package + create :debian_package_file, :dsc, evaluator.file_metadatum_trait, package: package + create :debian_package_file, :deb, evaluator.file_metadatum_trait, package: package + create :debian_package_file, :deb2, evaluator.file_metadatum_trait, package: package + create :debian_package_file, :udeb, evaluator.file_metadatum_trait, package: package + create :debian_package_file, :buildinfo, evaluator.file_metadatum_trait, package: package + create :debian_package_file, :changes, evaluator.file_metadatum_trait, package: package + end + end + factory :debian_incoming do name { 'incoming' } version { nil } + + transient do + without_package_files { false } + file_metadatum_trait { :unknown } + end end end |