Use AR callbacks as suggested by:

https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/4964#note_12744656
This commit is contained in:
Lin Jen-Shin
2016-06-29 17:44:39 +08:00
parent 1bc0d732f6
commit 9d8dca08e4
3 changed files with 11 additions and 4 deletions
+6 -2
View File
@@ -476,13 +476,17 @@ describe Ci::API::API do
describe 'DELETE /builds/:id/artifacts' do
let(:build) { create(:ci_build, :artifacts) }
before { delete delete_url, token: build.token }
before do
delete delete_url, token: build.token
build.reload
end
it 'should remove build artifacts' do
expect(response).to have_http_status(200)
expect(build.artifacts_file.exists?).to be_falsy
expect(build.artifacts_metadata.exists?).to be_falsy
expect(build.artifacts_size).to be_falsy
expect(build.artifacts_size).to eq(0)
end
end