BigW Consortium Gitlab

Commit 0e182197 by Kamil Trzcinski

Fix factory for artifacts

parent 592e0877
......@@ -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
......
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