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
|
@ -18,10 +18,13 @@ describe StatusFinder do
|
|||
|
||||
it 'raises an error if action is not :show' do
|
||||
recognized = Rails.application.routes.recognize_path(url)
|
||||
expect(recognized).to receive(:[]).with(:action).and_return(:create)
|
||||
expect(Rails.application.routes).to receive(:recognize_path).with(url).and_return(recognized)
|
||||
allow(recognized).to receive(:[]).with(:action).and_return(:create)
|
||||
allow(Rails.application.routes).to receive(:recognize_path).with(url).and_return(recognized)
|
||||
|
||||
expect { subject.status }.to raise_error(ActiveRecord::RecordNotFound)
|
||||
|
||||
expect(Rails.application.routes).to have_received(:recognize_path)
|
||||
expect(recognized).to have_received(:[])
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue