mirror of
https://github.com/Retrospring/retrospring.git
synced 2024-11-20 12:19:52 +01:00
Allow faker TLDs in testing
This commit is contained in:
parent
e21f5cb39d
commit
dad0d72cca
1 changed files with 1 additions and 1 deletions
|
@ -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 a new issue