mirror of
https://github.com/mastodon/mastodon.git
synced 2024-11-25 07:05:20 +00:00
Autofix Rubocop Lint/AmbiguousOperator (#23680)
This commit is contained in:
parent
ac59d6f19f
commit
6d42820e5d
|
@ -183,14 +183,6 @@ Lint/AmbiguousBlockAssociation:
|
|||
- 'spec/services/unsuspend_account_service_spec.rb'
|
||||
- 'spec/workers/scheduler/accounts_statuses_cleanup_scheduler_spec.rb'
|
||||
|
||||
# Offense count: 7
|
||||
# This cop supports safe autocorrection (--autocorrect).
|
||||
Lint/AmbiguousOperator:
|
||||
Exclude:
|
||||
- 'spec/controllers/api/v1/suggestions_controller_spec.rb'
|
||||
- 'spec/lib/request_spec.rb'
|
||||
- 'spec/models/user_role_spec.rb'
|
||||
|
||||
# Offense count: 17
|
||||
# This cop supports safe autocorrection (--autocorrect).
|
||||
Lint/AmbiguousOperatorPrecedence:
|
||||
|
|
|
@ -29,7 +29,7 @@ RSpec.describe Api::V1::SuggestionsController, type: :controller do
|
|||
json = body_as_json
|
||||
|
||||
expect(json.size).to be >= 1
|
||||
expect(json.map { |i| i[:id] }).to include *[bob, jeff].map { |i| i.id.to_s }
|
||||
expect(json.map { |i| i[:id] }).to include(*[bob, jeff].map { |i| i.id.to_s })
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -43,7 +43,7 @@ describe Request do
|
|||
before { stub_request(:get, 'http://example.com') }
|
||||
|
||||
it 'executes a HTTP request' do
|
||||
expect { |block| subject.perform &block }.to yield_control
|
||||
expect { |block| subject.perform(&block) }.to yield_control
|
||||
expect(a_request(:get, 'http://example.com')).to have_been_made.once
|
||||
end
|
||||
|
||||
|
@ -54,18 +54,18 @@ describe Request do
|
|||
allow(resolver).to receive(:timeouts=).and_return(nil)
|
||||
allow(Resolv::DNS).to receive(:open).and_yield(resolver)
|
||||
|
||||
expect { |block| subject.perform &block }.to yield_control
|
||||
expect { |block| subject.perform(&block) }.to yield_control
|
||||
expect(a_request(:get, 'http://example.com')).to have_been_made.once
|
||||
end
|
||||
|
||||
it 'sets headers' do
|
||||
expect { |block| subject.perform &block }.to yield_control
|
||||
expect { |block| subject.perform(&block) }.to yield_control
|
||||
expect(a_request(:get, 'http://example.com').with(headers: subject.headers)).to have_been_made
|
||||
end
|
||||
|
||||
it 'closes underlying connection' do
|
||||
expect_any_instance_of(HTTP::Client).to receive(:close)
|
||||
expect { |block| subject.perform &block }.to yield_control
|
||||
expect { |block| subject.perform(&block) }.to yield_control
|
||||
end
|
||||
|
||||
it 'returns response which implements body_with_limit' do
|
||||
|
|
|
@ -139,7 +139,7 @@ RSpec.describe UserRole, type: :model do
|
|||
end
|
||||
|
||||
it 'has negative position' do
|
||||
expect(subject.position).to eq -1
|
||||
expect(subject.position).to eq(-1)
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -159,7 +159,7 @@ RSpec.describe UserRole, type: :model do
|
|||
end
|
||||
|
||||
it 'has negative position' do
|
||||
expect(subject.position).to eq -1
|
||||
expect(subject.position).to eq(-1)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue