Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/services/tags/destroy_service_spec.rb')
-rw-r--r--spec/services/tags/destroy_service_spec.rb12
1 files changed, 11 insertions, 1 deletions
diff --git a/spec/services/tags/destroy_service_spec.rb b/spec/services/tags/destroy_service_spec.rb
index b46bd77eafe..6160f337552 100644
--- a/spec/services/tags/destroy_service_spec.rb
+++ b/spec/services/tags/destroy_service_spec.rb
@@ -2,7 +2,7 @@
require 'spec_helper'
-describe Tags::DestroyService do
+RSpec.describe Tags::DestroyService do
let(:project) { create(:project, :repository) }
let(:repository) { project.repository }
let(:user) { create(:user) }
@@ -11,6 +11,10 @@ describe Tags::DestroyService do
describe '#execute' do
subject { service.execute(tag_name) }
+ before do
+ allow(Ci::RefDeleteUnlockArtifactsWorker).to receive(:perform_async)
+ end
+
it 'removes the tag' do
expect(repository).to receive(:before_remove_tag)
expect(service).to receive(:success)
@@ -18,6 +22,12 @@ describe Tags::DestroyService do
service.execute('v1.1.0')
end
+ it 'calls the RefDeleteUnlockArtifactsWorker' do
+ expect(Ci::RefDeleteUnlockArtifactsWorker).to receive(:perform_async).with(project.id, user.id, 'refs/tags/v1.1.0')
+
+ service.execute('v1.1.0')
+ end
+
context 'when there is an associated release on the tag' do
let(:tag) { repository.tags.first }
let(:tag_name) { tag.name }