Add support of punycode domains in emails

This commit is contained in:
Alex Sherman 2020-06-15 15:57:44 +05:00
parent 56ac816dd1
commit b4369bdcd0
6 changed files with 77 additions and 21 deletions

View file

@ -270,6 +270,16 @@ class ContactTest < ActiveSupport::TestCase
assert_equal domain.whois_record.try(:json).try(:[], 'registrant'), @contact.name
end
def test_creates_email_verification_in_unicode
unicode_email = 'suur@äri.ee'
punycode_email = Contact.unicode_to_punycode(unicode_email)
@contact.email = punycode_email
@contact.save
assert_equal @contact.email_verification.email, unicode_email
end
private
def make_contact_free_of_domains_where_it_acts_as_a_registrant(contact)