1
0
Fork 0
forked from gitea/nas

Fix Lint/UselessAssignment cop (#27472)

This commit is contained in:
Matt Jankowski 2023-10-19 10:55:06 -04:00 committed by GitHub
parent 7bc8f03162
commit bcd0171e5e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 22 additions and 50 deletions

View file

@ -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

View file

@ -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]

View file

@ -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)

View file

@ -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