Allow faker TLDs in testing
This commit is contained in:
parent
e21f5cb39d
commit
dad0d72cca
|
@ -56,7 +56,7 @@ class TypoedEmailValidator < ActiveModel::EachValidator
|
||||||
|
|
||||||
# check if the TLD is valid
|
# check if the TLD is valid
|
||||||
tld = domain_parts.last
|
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
|
# finally, common typos
|
||||||
return false if INVALID_ENDINGS.any? { value.end_with?(_1) }
|
return false if INVALID_ENDINGS.any? { value.end_with?(_1) }
|
||||||
|
|
Loading…
Reference in New Issue