0
0
Fork 0

Enable Rubocop RSpec/NotToNot (#23723)

This commit is contained in:
Nick Schonning 2023-02-19 20:33:27 -05:00 committed by GitHub
parent a2fdb388eb
commit 65ba0d92ef
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
40 changed files with 94 additions and 214 deletions

View file

@ -26,7 +26,7 @@ RSpec.describe BlacklistedEmailValidator, type: :validator do
let(:blocked_email) { false }
it 'does not add errors' do
expect(subject).not_to have_received(:add).with(:email, :blocked)
expect(subject).to_not have_received(:add).with(:email, :blocked)
end
context 'when canonical e-mail is blocked' do

View file

@ -19,7 +19,7 @@ RSpec.describe DisallowedHashtagsValidator, type: :validator do
let(:reblog) { true }
it 'does not add errors' do
expect(errors).not_to have_received(:add).with(:text, any_args)
expect(errors).to_not have_received(:add).with(:text, any_args)
end
end
@ -31,7 +31,7 @@ RSpec.describe DisallowedHashtagsValidator, type: :validator do
let(:disallowed_tags) { [] }
it 'does not add errors' do
expect(errors).not_to have_received(:add).with(:text, any_args)
expect(errors).to_not have_received(:add).with(:text, any_args)
end
end

View file

@ -38,7 +38,7 @@ describe EmailMxValidator do
allow(Resolv::DNS).to receive(:open).and_yield(resolver)
subject.validate(user)
expect(user.errors).not_to have_received(:add)
expect(user.errors).to_not have_received(:add)
end
it 'adds an error if the email domain name contains empty labels' do

View file

@ -22,7 +22,7 @@ RSpec.describe FollowLimitValidator, type: :validator do
let(:_nil) { true }
it 'not calls errors.add' do
expect(errors).not_to have_received(:add).with(:base, any_args)
expect(errors).to_not have_received(:add).with(:base, any_args)
end
end
@ -43,7 +43,7 @@ RSpec.describe FollowLimitValidator, type: :validator do
let(:limit_reached) { false }
it 'not calls errors.add' do
expect(errors).not_to have_received(:add).with(:base, any_args)
expect(errors).to_not have_received(:add).with(:base, any_args)
end
end
end

View file

@ -15,14 +15,14 @@ RSpec.describe PollValidator, type: :validator do
let(:expires_at) { 1.day.from_now }
it 'have no errors' do
expect(errors).not_to have_received(:add)
expect(errors).to_not have_received(:add)
end
context 'expires just 5 min ago' do
let(:expires_at) { 5.minutes.from_now }
it 'not calls errors add' do
expect(errors).not_to have_received(:add)
expect(errors).to_not have_received(:add)
end
end
end

View file

@ -7,13 +7,13 @@ describe StatusLengthValidator do
it 'does not add errors onto remote statuses' do
status = double(local?: false)
subject.validate(status)
expect(status).not_to receive(:errors)
expect(status).to_not receive(:errors)
end
it 'does not add errors onto local reblogs' do
status = double(local?: false, reblog?: true)
subject.validate(status)
expect(status).not_to receive(:errors)
expect(status).to_not receive(:errors)
end
it 'adds an error when content warning is over 500 characters' do

View file

@ -17,7 +17,7 @@ RSpec.describe UnreservedUsernameValidator, type: :validator do
let(:username) { nil }
it 'not calls errors.add' do
expect(errors).not_to have_received(:add).with(:username, any_args)
expect(errors).to_not have_received(:add).with(:username, any_args)
end
end
@ -36,7 +36,7 @@ RSpec.describe UnreservedUsernameValidator, type: :validator do
let(:reserved_username) { false }
it 'not calls errors.add' do
expect(errors).not_to have_received(:add).with(:username, any_args)
expect(errors).to_not have_received(:add).with(:username, any_args)
end
end
end

View file

@ -27,7 +27,7 @@ RSpec.describe URLValidator, type: :validator do
let(:compliant) { true }
it 'not calls errors.add' do
expect(errors).not_to have_received(:add).with(attribute, any_args)
expect(errors).to_not have_received(:add).with(attribute, any_args)
end
end
end