diff options
Diffstat (limited to 'spec/factories/packages/helm')
-rw-r--r-- | spec/factories/packages/helm/file_metadatum.rb | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/spec/factories/packages/helm/file_metadatum.rb b/spec/factories/packages/helm/file_metadatum.rb index cbc7e114ef6..3f599b5d5c0 100644 --- a/spec/factories/packages/helm/file_metadatum.rb +++ b/spec/factories/packages/helm/file_metadatum.rb @@ -2,8 +2,16 @@ FactoryBot.define do factory :helm_file_metadatum, class: 'Packages::Helm::FileMetadatum' do + transient do + description { nil } + end + package_file { association(:helm_package_file, without_loaded_metadatum: true) } sequence(:channel) { |n| "#{FFaker::Lorem.word}-#{n}" } - metadata { { 'name': package_file.package.name, 'version': package_file.package.version, 'apiVersion': 'v2' } } + metadata do + { 'name': package_file.package.name, 'version': package_file.package.version, 'apiVersion': 'v2' }.tap do |defaults| + defaults['description'] = description if description + end + end end end |