Commit 0e182197 authored by Kamil Trzcinski's avatar Kamil Trzcinski

Fix factory for artifacts

parent 592e0877
...@@ -10,22 +10,20 @@ FactoryGirl.define do ...@@ -10,22 +10,20 @@ FactoryGirl.define do
end end
trait :archive do trait :archive do
after(:create) do |artifact, _| file_type :archive
artifact.update!(
file_type: :archive, after(:build) do |artifact, _|
file: fixture_file_upload( artifact.file = fixture_file_upload(
Rails.root.join('spec/fixtures/ci_build_artifacts.zip'), 'application/zip') Rails.root.join('spec/fixtures/ci_build_artifacts.zip'), 'application/zip')
)
end end
end end
trait :metadata do trait :metadata do
after(:create) do |artifact, _| file_type :metadata
artifact.update!(
file_type: :metadata, after(:build) do |artifact, _|
file: fixture_file_upload( artifact.file = fixture_file_upload(
Rails.root.join('spec/fixtures/ci_build_artifacts_metadata.gz'), 'application/x-gzip') Rails.root.join('spec/fixtures/ci_build_artifacts_metadata.gz'), 'application/x-gzip')
)
end end
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment