Allow faker TLDs in testing

This commit is contained in:
Karina Kwiatek 2023-10-20 09:52:48 +02:00
parent e21f5cb39d
commit dad0d72cca
1 changed files with 1 additions and 1 deletions

View File

@ -56,7 +56,7 @@ class TypoedEmailValidator < ActiveModel::EachValidator
# check if the TLD is valid
tld = domain_parts.last
return false unless TLDv.valid?(tld)
return false unless TLDv.valid?(tld) || (Rails.env.test? && %w[example test].include?(tld))
# finally, common typos
return false if INVALID_ENDINGS.any? { value.end_with?(_1) }