0
0
Fork 0

Fix RSpec/VerifiedDoubles cop (#25469)

This commit is contained in:
Matt Jankowski 2023-06-22 08:55:22 -04:00 committed by GitHub
parent 38433ccd0b
commit 05f9e39b32
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
50 changed files with 162 additions and 172 deletions

View file

@ -25,7 +25,7 @@ describe SearchService, type: :service do
context 'when it does not find anything' do
it 'returns the empty results' do
service = double(call: nil)
service = instance_double(ResolveURLService, call: nil)
allow(ResolveURLService).to receive(:new).and_return(service)
results = subject.call(@query, nil, 10, resolve: true)
@ -37,7 +37,7 @@ describe SearchService, type: :service do
context 'when it finds an account' do
it 'includes the account in the results' do
account = Account.new
service = double(call: account)
service = instance_double(ResolveURLService, call: account)
allow(ResolveURLService).to receive(:new).and_return(service)
results = subject.call(@query, nil, 10, resolve: true)
@ -49,7 +49,7 @@ describe SearchService, type: :service do
context 'when it finds a status' do
it 'includes the status in the results' do
status = Status.new
service = double(call: status)
service = instance_double(ResolveURLService, call: status)
allow(ResolveURLService).to receive(:new).and_return(service)
results = subject.call(@query, nil, 10, resolve: true)
@ -64,7 +64,7 @@ describe SearchService, type: :service do
it 'includes the account in the results' do
query = 'username'
account = Account.new
service = double(call: [account])
service = instance_double(AccountSearchService, call: [account])
allow(AccountSearchService).to receive(:new).and_return(service)
results = subject.call(query, nil, 10)