Autofix Rubocop RSpec/ReturnFromStub (#23724)

main
Nick Schonning 2 years ago committed by GitHub
parent 21bf326356
commit a2fdb388eb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1923,19 +1923,6 @@ RSpec/RepeatedExampleGroupDescription:
- 'spec/controllers/admin/reports/actions_controller_spec.rb'
- 'spec/policies/report_note_policy_spec.rb'
# Offense count: 6
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle.
# SupportedStyles: and_return, block
RSpec/ReturnFromStub:
Exclude:
- 'spec/controllers/api/v1/accounts/credentials_controller_spec.rb'
- 'spec/controllers/api/v1/apps/credentials_controller_spec.rb'
- 'spec/controllers/api/v1/statuses/favourited_by_accounts_controller_spec.rb'
- 'spec/controllers/api/v1/statuses/reblogged_by_accounts_controller_spec.rb'
- 'spec/controllers/api/v1/statuses_controller_spec.rb'
- 'spec/validators/blacklisted_email_validator_spec.rb'
# Offense count: 18
# This cop supports safe autocorrection (--autocorrect).
RSpec/ScatteredLet:

@ -86,7 +86,7 @@ describe Api::V1::Accounts::CredentialsController do
context 'without an oauth token' do
before do
allow(controller).to receive(:doorkeeper_token) { nil }
allow(controller).to receive(:doorkeeper_token).and_return(nil)
end
describe 'GET #show' do

@ -30,7 +30,7 @@ describe Api::V1::Apps::CredentialsController do
context 'without an oauth token' do
before do
allow(controller).to receive(:doorkeeper_token) { nil }
allow(controller).to receive(:doorkeeper_token).and_return(nil)
end
describe 'GET #show' do

@ -45,7 +45,7 @@ RSpec.describe Api::V1::Statuses::FavouritedByAccountsController, type: :control
context 'without an oauth token' do
before do
allow(controller).to receive(:doorkeeper_token) { nil }
allow(controller).to receive(:doorkeeper_token).and_return(nil)
end
context 'with a private status' do

@ -45,7 +45,7 @@ RSpec.describe Api::V1::Statuses::RebloggedByAccountsController, type: :controll
context 'without an oauth token' do
before do
allow(controller).to receive(:doorkeeper_token) { nil }
allow(controller).to receive(:doorkeeper_token).and_return(nil)
end
context 'with a private status' do

@ -219,7 +219,7 @@ RSpec.describe Api::V1::StatusesController, type: :controller do
context 'without an oauth token' do
before do
allow(controller).to receive(:doorkeeper_token) { nil }
allow(controller).to receive(:doorkeeper_token).and_return(nil)
end
context 'with a private status' do

@ -8,7 +8,7 @@ RSpec.describe BlacklistedEmailValidator, type: :validator do
let(:errors) { double(add: nil) }
before do
allow(user).to receive(:valid_invitation?) { false }
allow(user).to receive(:valid_invitation?).and_return(false)
allow_any_instance_of(described_class).to receive(:blocked_email_provider?) { blocked_email }
end

Loading…
Cancel
Save