diff options
author | Shinya Maeda <shinya@gitlab.com> | 2018-07-19 18:23:41 +0900 |
---|---|---|
committer | Shinya Maeda <shinya@gitlab.com> | 2018-07-19 18:23:41 +0900 |
commit | 95502e605af9bcf1a61dbeb26f9be4d181f8a7ba (patch) | |
tree | 35188e42eb97104ce7268796d2b8f078a07f1f05 | |
parent | a3930853c93862007ba6814511bc32042c7f4986 (diff) | |
download | gitlab-ce-95502e605af9bcf1a61dbeb26f9be4d181f8a7ba.tar.gz |
Fix artifact migratable
-rw-r--r-- | app/models/concerns/artifact_migratable.rb | 4 | ||||
-rw-r--r-- | spec/requests/api/jobs_spec.rb | 4 |
2 files changed, 5 insertions, 3 deletions
diff --git a/app/models/concerns/artifact_migratable.rb b/app/models/concerns/artifact_migratable.rb index ca9aba5ac3a..5ce7d693249 100644 --- a/app/models/concerns/artifact_migratable.rb +++ b/app/models/concerns/artifact_migratable.rb @@ -31,8 +31,8 @@ module ArtifactMigratable end def remove_artifacts_metadata! - if job_artifacts_metadata - job_artifacts_metadata.destroy + if job_artifacts_archive_metadata + job_artifacts_archive_metadata.destroy else remove_legacy_artifacts_metadata! end diff --git a/spec/requests/api/jobs_spec.rb b/spec/requests/api/jobs_spec.rb index 7d1a5c12805..46d9a363b02 100644 --- a/spec/requests/api/jobs_spec.rb +++ b/spec/requests/api/jobs_spec.rb @@ -654,13 +654,15 @@ describe API::Jobs do end context 'job is erasable' do - let(:job) { create(:ci_build, :trace_artifact, :artifacts, :success, project: project, pipeline: pipeline) } + let(:job) { create(:ci_build, :trace_artifact, :artifacts, :test_reports, :success, project: project, pipeline: pipeline) } it 'erases job content' do expect(response).to have_gitlab_http_status(201) + expect(job.job_artifacts.count).to eq(0) expect(job.trace.exist?).to be_falsy expect(job.artifacts_file.exists?).to be_falsy expect(job.artifacts_metadata.exists?).to be_falsy + expect(job.has_test_reports?).to be_falsy end it 'updates job' do |