diff options
author | Kamil Trzcinski <ayufan@ayufan.eu> | 2017-11-02 12:16:50 +0100 |
---|---|---|
committer | Kamil Trzcinski <ayufan@ayufan.eu> | 2017-12-03 12:04:48 +0100 |
commit | 303f165cbae8367c19ea273fc52170c2a354a8d6 (patch) | |
tree | 169d40f5e4f7b31b0f74be2500cfc87601c93c42 /spec | |
parent | 61864a5a5bb523953589c9398a431c4369fbfc76 (diff) | |
download | gitlab-ce-303f165cbae8367c19ea273fc52170c2a354a8d6.tar.gz |
Fix creation of job_artifact_uploader
Diffstat (limited to 'spec')
-rw-r--r-- | spec/factories/ci/builds.rb | 6 | ||||
-rw-r--r-- | spec/factories/ci/job_artifacts.rb | 6 |
2 files changed, 8 insertions, 4 deletions
diff --git a/spec/factories/ci/builds.rb b/spec/factories/ci/builds.rb index 6cb612a58d2..ee449bfe5db 100644 --- a/spec/factories/ci/builds.rb +++ b/spec/factories/ci/builds.rb @@ -155,8 +155,10 @@ FactoryGirl.define do end trait :artifacts do - job_archive factory: :ci_job_artifact - job_metadata factory: :ci_job_metadata + after(:create) do |build| + create(:ci_job_artifact, job: build) + create(:ci_job_metadata, job: build) + end end trait :expired do diff --git a/spec/factories/ci/job_artifacts.rb b/spec/factories/ci/job_artifacts.rb index 8a7e04c747f..0abebd14286 100644 --- a/spec/factories/ci/job_artifacts.rb +++ b/spec/factories/ci/job_artifacts.rb @@ -2,15 +2,17 @@ include ActionDispatch::TestProcess FactoryGirl.define do factory :ci_job_artifact, class: Ci::JobArtifact do - project job factory: :ci_build file_type :archive + after :build do |artifact| + artifact.project ||= artifact.job.project + end + after :create do |artifact| if artifact.archive? artifact.file = fixture_file_upload(Rails.root.join('spec/fixtures/ci_build_artifacts.zip'), 'application/zip') - artifact.save end end |