diff options
Diffstat (limited to 'spec/factories/packages/debian/component_file.rb')
-rw-r--r-- | spec/factories/packages/debian/component_file.rb | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/spec/factories/packages/debian/component_file.rb b/spec/factories/packages/debian/component_file.rb new file mode 100644 index 00000000000..19157b3c8c6 --- /dev/null +++ b/spec/factories/packages/debian/component_file.rb @@ -0,0 +1,39 @@ +# frozen_string_literal: true + +FactoryBot.define do + factory :debian_project_component_file, class: 'Packages::Debian::ProjectComponentFile' do + 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| + component_file.file = fixture_file_upload('spec/fixtures/packages/debian/distribution/Packages') + end + + file_md5 { '12345abcde' } + file_sha256 { 'be93151dc23ac34a82752444556fe79b32c7a1ad' } + + trait(:packages) do + file_type { :packages } + end + + trait(:source) do + file_type { :source } + architecture { nil } + end + + trait(:di_packages) do + file_type { :di_packages } + end + + trait(:object_storage) do + file_store { Packages::PackageFileUploader::Store::REMOTE } + end + end +end |