diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-01-17 18:07:22 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-01-17 18:07:22 +0300 |
commit | d41edc2e93480db35e48ad770ebe95075fbca871 (patch) | |
tree | 09d4f5cd1575babf508c73a2653f68b35cd1e936 /spec/workers | |
parent | b17a559378235d37f5168d8d18818043cdaaf90b (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/workers')
-rw-r--r-- | spec/workers/ci/build_finished_worker_spec.rb | 6 | ||||
-rw-r--r-- | spec/workers/projects/delete_branch_worker_spec.rb | 8 |
2 files changed, 11 insertions, 3 deletions
diff --git a/spec/workers/ci/build_finished_worker_spec.rb b/spec/workers/ci/build_finished_worker_spec.rb index e8bb3988001..049f3af1dd7 100644 --- a/spec/workers/ci/build_finished_worker_spec.rb +++ b/spec/workers/ci/build_finished_worker_spec.rb @@ -65,6 +65,12 @@ RSpec.describe Ci::BuildFinishedWorker do subject end end + + context 'when it has a token' do + it 'removes the token' do + expect { subject }.to change { build.reload.token }.to(nil) + end + end end context 'when build does not exist' do diff --git a/spec/workers/projects/delete_branch_worker_spec.rb b/spec/workers/projects/delete_branch_worker_spec.rb index ec3feecccdc..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,7 +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(service_result).not_to receive(:log_and_raise_exception) expect { worker.perform(project.id, user.id, branch) }.not_to raise_error end |