diff options
author | Paco Guzman <pacoguzmanp@gmail.com> | 2016-07-28 08:09:40 +0300 |
---|---|---|
committer | Paco Guzman <pacoguzmanp@gmail.com> | 2016-07-29 15:08:41 +0300 |
commit | d05af7b7c6975ae66808ed6676a1b947c7abe244 (patch) | |
tree | b158cf69a40b7806691f877292eb5c94b6f2cae9 /spec/factories/ci | |
parent | 41057b856eaf309ba6a80c03fa284dd07e2c73a3 (diff) |
Check for Ci::Build artifacts at database level
Diffstat (limited to 'spec/factories/ci')
-rw-r--r-- | spec/factories/ci/builds.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/factories/ci/builds.rb b/spec/factories/ci/builds.rb index 5e19e403c6b..1b32d560b16 100644 --- a/spec/factories/ci/builds.rb +++ b/spec/factories/ci/builds.rb @@ -90,5 +90,21 @@ FactoryGirl.define do build.save! end end + + trait :artifacts_expired do + after(:create) do |build, _| + build.artifacts_file = + fixture_file_upload(Rails.root.join('spec/fixtures/ci_build_artifacts.zip'), + 'application/zip') + + build.artifacts_metadata = + fixture_file_upload(Rails.root.join('spec/fixtures/ci_build_artifacts_metadata.gz'), + 'application/x-gzip') + + build.artifacts_expire_at = 1.minute.ago + + build.save! + end + end end end |