Commit 87bd9c56 authored by Robert Speicher's avatar Robert Speicher

Merge branch '36378-error-raising-expectation-in-spec-fix' into 'master'

Fix positive raise_error expectation without specifying the error type expected…

Closes #36378

See merge request !13542
parents bd36637b 9371cf3a
...@@ -142,13 +142,13 @@ describe Projects::DestroyService do ...@@ -142,13 +142,13 @@ describe Projects::DestroyService do
context 'when `execute` raises unexpected error' do context 'when `execute` raises unexpected error' do
before do before do
expect_any_instance_of(Project) expect_any_instance_of(Project)
.to receive(:destroy!).and_raise(Exception.new("Other error message")) .to receive(:destroy!).and_raise(Exception.new('Other error message'))
end end
it 'allows error to bubble up and rolls back project deletion' do it 'allows error to bubble up and rolls back project deletion' do
expect do expect do
Sidekiq::Testing.inline! { destroy_project(project, user, {}) } Sidekiq::Testing.inline! { destroy_project(project, user, {}) }
end.to raise_error end.to raise_error(Exception, 'Other error message')
expect(project.reload.pending_delete).to be(false) expect(project.reload.pending_delete).to be(false)
expect(project.delete_error).to include("Other error message") expect(project.delete_error).to include("Other error message")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment