Fix RSpec/StubbedMock
cop (#25552)
Co-authored-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
parent
2e1391fdd2
commit
6c5a2233a8
9 changed files with 26 additions and 31 deletions
|
@ -88,10 +88,11 @@ describe Api::BaseController do
|
|||
Mastodon::NotPermittedError => 403,
|
||||
}.each do |error, code|
|
||||
it "Handles error class of #{error}" do
|
||||
expect(FakeService).to receive(:new).and_raise(error)
|
||||
allow(FakeService).to receive(:new).and_raise(error)
|
||||
|
||||
get 'error'
|
||||
expect(response).to have_http_status(code)
|
||||
expect(FakeService).to have_received(:new)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue