0
0
Fork 0

Fix RSpec/MessageSpies cop (#27751)

This commit is contained in:
Matt Jankowski 2023-11-07 04:46:28 -05:00 committed by GitHub
parent ae0d551d33
commit 49e2772064
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 162 additions and 94 deletions

View file

@ -29,12 +29,16 @@ describe WebfingerResource do
allow(recognized).to receive(:[]).with(:username).and_return('alice')
allow(recognized).to receive(:[]).with(:action).and_return('create')
expect(Rails.application.routes).to receive(:recognize_path).with(resource).and_return(recognized).at_least(:once)
allow(Rails.application.routes).to receive(:recognize_path).with(resource).and_return(recognized)
expect do
described_class.new(resource).username
end.to raise_error(ActiveRecord::RecordNotFound)
expect(recognized).to have_received(:[]).exactly(3).times
expect(Rails.application.routes).to have_received(:recognize_path)
.with(resource)
.at_least(:once)
end
it 'raises with a string that doesnt start with URL' do