diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-01-18 22:00:14 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-01-18 22:00:14 +0300 |
commit | 05f0ebba3a2c8ddf39e436f412dc2ab5bf1353b2 (patch) | |
tree | 11d0f2a6ec31c7793c184106cedc2ded3d9a2cc5 /spec/workers/projects/delete_branch_worker_spec.rb | |
parent | ec73467c23693d0db63a797d10194da9e72a74af (diff) |
Add latest changes from gitlab-org/gitlab@15-8-stable-eev15.8.0-rc42
Diffstat (limited to 'spec/workers/projects/delete_branch_worker_spec.rb')
-rw-r--r-- | spec/workers/projects/delete_branch_worker_spec.rb | 26 |
1 files changed, 5 insertions, 21 deletions
diff --git a/spec/workers/projects/delete_branch_worker_spec.rb b/spec/workers/projects/delete_branch_worker_spec.rb index c1289f56929..771ab3def84 100644 --- a/spec/workers/projects/delete_branch_worker_spec.rb +++ b/spec/workers/projects/delete_branch_worker_spec.rb @@ -64,9 +64,11 @@ RSpec.describe Projects::DeleteBranchWorker, feature_category: :source_code_mana expect(instance).to receive(:execute).with(branch).and_return(service_result) end - expect(service_result).to receive(:track_and_raise_exception).and_call_original + expect(service_result).to receive(:log_and_raise_exception).and_call_original - expect { worker.perform(project.id, user.id, branch) }.to raise_error(StandardError) + expect do + worker.perform(project.id, user.id, branch) + end.to raise_error(Projects::DeleteBranchWorker::GitReferenceLockedError) end end @@ -78,25 +80,7 @@ RSpec.describe Projects::DeleteBranchWorker, feature_category: :source_code_mana expect(instance).to receive(:execute).with(branch).and_return(service_result) end - expect(service_result).not_to receive(:track_and_raise_exception) - - expect { worker.perform(project.id, user.id, branch) }.not_to raise_error - end - end - - context 'when track_and_raise_delete_source_errors is disabled' do - let(:status_code) { 400 } - - before do - stub_feature_flags(track_and_raise_delete_source_errors: false) - end - - it 'does not track the exception' do - expect_next_instance_of(::Branches::DeleteService) do |instance| - expect(instance).to receive(:execute).with(branch).and_return(service_result) - end - - expect(service_result).not_to receive(:track_and_raise_exception) + expect(service_result).not_to receive(:log_and_raise_exception) expect { worker.perform(project.id, user.id, branch) }.not_to raise_error end |