Enable Rubocop RSpec/NotToNot (#23723)
This commit is contained in:
@@ -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
|
||||
|
@@ -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
|
||||
|
||||
|
@@ -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
|
||||
|
@@ -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
|
||||
|
@@ -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
|
||||
|
@@ -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
|
||||
|
@@ -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
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user