Skip to content
Snippets Groups Projects
Commit d63673d6 authored by Kamil Trzcinski's avatar Kamil Trzcinski
Browse files

Make sure that artifacts_file is nullified after removing artifacts

parent faee4763
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -341,6 +341,7 @@ module Ci
def erase_artifacts!
remove_artifacts_file!
remove_artifacts_metadata!
save
end
 
def erase(opts = {})
Loading
Loading
Loading
Loading
@@ -20,6 +20,10 @@ describe ExpireBuildArtifactsWorker do
it 'does remove files' do
expect(build.reload.artifacts_file.exists?).to be_falsey
end
it 'does nullify artifacts_file column' do
expect(build.reload.artifacts_file_identifier).to be_nil
end
end
 
context 'with not yet expired artifacts' do
Loading
Loading
@@ -32,6 +36,10 @@ describe ExpireBuildArtifactsWorker do
it 'does not remove files' do
expect(build.reload.artifacts_file.exists?).to be_truthy
end
it 'does not nullify artifacts_file column' do
expect(build.reload.artifacts_file_identifier).not_to be_nil
end
end
 
context 'without expire date' do
Loading
Loading
@@ -44,6 +52,10 @@ describe ExpireBuildArtifactsWorker do
it 'does not remove files' do
expect(build.reload.artifacts_file.exists?).to be_truthy
end
it 'does not nullify artifacts_file column' do
expect(build.reload.artifacts_file_identifier).not_to be_nil
end
end
 
context 'for expired artifacts' do
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment