diff options
author | ThibG <thib@sitedethib.com> | 2020-08-12 12:40:25 +0200 |
---|---|---|
committer | Starfall <us@starfall.systems> | 2020-08-25 13:36:49 -0500 |
commit | f2099bcc533a221a597fabc585ddfe7f295db851 (patch) | |
tree | 8437386bb0d319fa28a7199c29781bd2ab985590 /spec/validators | |
parent | d1cf10154133d63a770fe263d788908b04571513 (diff) |
Improve email address validation (#14565)
* Increase DNS timeout from 1 second to 5 seconds for MX check 1 seconds is rather short when using a recursive DNS resolver which hasn't got a cached result already available. Use 5 seconds instead, which is the timeout value we use for outgoing HTTP queries. * Add more precise error messages for invalid e-mail addresses
Diffstat (limited to 'spec/validators')
-rw-r--r-- | spec/validators/blacklisted_email_validator_spec.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/spec/validators/blacklisted_email_validator_spec.rb b/spec/validators/blacklisted_email_validator_spec.rb index ccc5dc0f4..f0708dc46 100644 --- a/spec/validators/blacklisted_email_validator_spec.rb +++ b/spec/validators/blacklisted_email_validator_spec.rb @@ -17,7 +17,7 @@ RSpec.describe BlacklistedEmailValidator, type: :validator do let(:blocked_email) { true } it 'calls errors.add' do - expect(errors).to have_received(:add).with(:email, I18n.t('users.invalid_email')) + expect(errors).to have_received(:add).with(:email, I18n.t('users.blocked_email_provider')) end end @@ -25,7 +25,7 @@ RSpec.describe BlacklistedEmailValidator, type: :validator do let(:blocked_email) { false } it 'not calls errors.add' do - expect(errors).not_to have_received(:add).with(:email, I18n.t('users.invalid_email')) + expect(errors).not_to have_received(:add).with(:email, I18n.t('users.blocked_email_provider')) end end end |