diff options
Diffstat (limited to 'spec/factories/packages/composer/cache_files.rb')
-rw-r--r-- | spec/factories/packages/composer/cache_files.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/spec/factories/packages/composer/cache_files.rb b/spec/factories/packages/composer/cache_files.rb new file mode 100644 index 00000000000..30c28ec175b --- /dev/null +++ b/spec/factories/packages/composer/cache_files.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true +FactoryBot.define do + factory :composer_cache_file, class: 'Packages::Composer::CacheFile' do + group + + file_sha256 { '1' * 64 } + + transient do + file_fixture { 'spec/fixtures/packages/composer/package.json' } + end + + after(:build) do |cache_file, evaluator| + cache_file.file = fixture_file_upload(evaluator.file_fixture) + end + + trait(:object_storage) do + file_store { Packages::Composer::CacheUploader::Store::REMOTE } + end + end +end |