diff options
author | Kamil Trzcinski <ayufan@ayufan.eu> | 2017-11-30 18:32:16 +0100 |
---|---|---|
committer | Kamil Trzcinski <ayufan@ayufan.eu> | 2017-12-03 12:05:23 +0100 |
commit | 0e1821973da36d995cf1f9673300c59af8c82294 (patch) | |
tree | bd292ee917ccfcc76a03c34fd9c4bfd5780f4683 /spec/factories | |
parent | 592e0877f470efbb224043a6f887265afa070e0b (diff) | |
download | gitlab-ce-0e1821973da36d995cf1f9673300c59af8c82294.tar.gz |
Fix factory for artifacts
Diffstat (limited to 'spec/factories')
-rw-r--r-- | spec/factories/ci/job_artifacts.rb | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/spec/factories/ci/job_artifacts.rb b/spec/factories/ci/job_artifacts.rb index 47c9842e698..cf05472c369 100644 --- a/spec/factories/ci/job_artifacts.rb +++ b/spec/factories/ci/job_artifacts.rb @@ -10,22 +10,20 @@ FactoryGirl.define do end trait :archive do - after(:create) do |artifact, _| - artifact.update!( - file_type: :archive, - file: fixture_file_upload( + file_type :archive + + after(:build) do |artifact, _| + artifact.file = fixture_file_upload( Rails.root.join('spec/fixtures/ci_build_artifacts.zip'), 'application/zip') - ) end end trait :metadata do - after(:create) do |artifact, _| - artifact.update!( - file_type: :metadata, - file: fixture_file_upload( - Rails.root.join('spec/fixtures/ci_build_artifacts_metadata.gz'), 'application/x-gzip') - ) + file_type :metadata + + after(:build) do |artifact, _| + artifact.file = fixture_file_upload( + Rails.root.join('spec/fixtures/ci_build_artifacts_metadata.gz'), 'application/x-gzip') end end end |