Fix Lint/UselessAssignment
cop (#27472)
This commit is contained in:
parent
7bc8f03162
commit
bcd0171e5e
16 changed files with 22 additions and 50 deletions
|
@ -56,7 +56,7 @@ describe AccountSearchService, type: :service do
|
|||
service = instance_double(ResolveAccountService, call: nil)
|
||||
allow(ResolveAccountService).to receive(:new).and_return(service)
|
||||
|
||||
results = subject.call('newuser@remote.com', nil, limit: 10, resolve: true)
|
||||
subject.call('newuser@remote.com', nil, limit: 10, resolve: true)
|
||||
expect(service).to have_received(:call).with('newuser@remote.com')
|
||||
end
|
||||
|
||||
|
@ -64,14 +64,14 @@ describe AccountSearchService, type: :service do
|
|||
service = instance_double(ResolveAccountService, call: nil)
|
||||
allow(ResolveAccountService).to receive(:new).and_return(service)
|
||||
|
||||
results = subject.call('newuser@remote.com', nil, limit: 10, resolve: false)
|
||||
subject.call('newuser@remote.com', nil, limit: 10, resolve: false)
|
||||
expect(service).to_not have_received(:call)
|
||||
end
|
||||
end
|
||||
|
||||
it 'returns the fuzzy match first, and does not return suspended exacts' do
|
||||
partial = Fabricate(:account, username: 'exactness')
|
||||
exact = Fabricate(:account, username: 'exact', suspended: true)
|
||||
Fabricate(:account, username: 'exact', suspended: true)
|
||||
results = subject.call('exact', nil, limit: 10)
|
||||
|
||||
expect(results.size).to eq 1
|
||||
|
@ -79,7 +79,7 @@ describe AccountSearchService, type: :service do
|
|||
end
|
||||
|
||||
it 'does not return suspended remote accounts' do
|
||||
remote = Fabricate(:account, username: 'a', domain: 'remote', display_name: 'e', suspended: true)
|
||||
Fabricate(:account, username: 'a', domain: 'remote', display_name: 'e', suspended: true)
|
||||
results = subject.call('a@example.com', nil, limit: 2)
|
||||
|
||||
expect(results.size).to eq 0
|
||||
|
|
|
@ -155,7 +155,7 @@ RSpec.describe PostStatusService, type: :service do
|
|||
|
||||
it 'processes duplicate mentions correctly' do
|
||||
account = Fabricate(:account)
|
||||
mentioned_account = Fabricate(:account, username: 'alice')
|
||||
Fabricate(:account, username: 'alice')
|
||||
|
||||
expect do
|
||||
subject.call(account, text: '@alice @alice @alice hey @alice')
|
||||
|
@ -212,7 +212,7 @@ RSpec.describe PostStatusService, type: :service do
|
|||
account = Fabricate(:account)
|
||||
media = Fabricate(:media_attachment, account: Fabricate(:account))
|
||||
|
||||
status = subject.call(
|
||||
subject.call(
|
||||
account,
|
||||
text: 'test status update',
|
||||
media_ids: [media.id]
|
||||
|
|
|
@ -27,7 +27,7 @@ RSpec.describe PrecomputeFeedService, type: :service do
|
|||
muted_account = Fabricate(:account)
|
||||
Fabricate(:mute, account: account, target_account: muted_account)
|
||||
reblog = Fabricate(:status, account: muted_account)
|
||||
status = Fabricate(:status, account: account, reblog: reblog)
|
||||
Fabricate(:status, account: account, reblog: reblog)
|
||||
|
||||
subject.call(account)
|
||||
|
||||
|
|
|
@ -7,8 +7,8 @@ describe ResolveURLService, type: :service do
|
|||
|
||||
describe '#call' do
|
||||
it 'returns nil when there is no resource url' do
|
||||
url = 'http://example.com/missing-resource'
|
||||
known_account = Fabricate(:account, uri: url, domain: 'example.com')
|
||||
url = 'http://example.com/missing-resource'
|
||||
Fabricate(:account, uri: url, domain: 'example.com')
|
||||
service = instance_double(FetchResourceService)
|
||||
|
||||
allow(FetchResourceService).to receive(:new).and_return service
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue