diff options
Diffstat (limited to 'spec/services/branches')
-rw-r--r-- | spec/services/branches/delete_service_spec.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/services/branches/delete_service_spec.rb b/spec/services/branches/delete_service_spec.rb index b57817e9f59..f1e7c9340b1 100644 --- a/spec/services/branches/delete_service_spec.rb +++ b/spec/services/branches/delete_service_spec.rb @@ -10,6 +10,10 @@ RSpec.describe Branches::DeleteService do subject(:service) { described_class.new(project, user) } shared_examples 'a deleted branch' do |branch_name| + before do + allow(Ci::RefDeleteUnlockArtifactsWorker).to receive(:perform_async) + end + it 'removes the branch' do expect(branch_exists?(branch_name)).to be true @@ -18,6 +22,12 @@ RSpec.describe Branches::DeleteService do expect(result.status).to eq :success expect(branch_exists?(branch_name)).to be false end + + it 'calls the RefDeleteUnlockArtifactsWorker' do + expect(Ci::RefDeleteUnlockArtifactsWorker).to receive(:perform_async).with(project.id, user.id, "refs/heads/#{branch_name}") + + service.execute(branch_name) + end end describe '#execute' do |