mirror of
https://github.com/internetee/registry.git
synced 2025-06-10 06:34:46 +02:00
Add support of punycode domains in emails
This commit is contained in:
parent
56ac816dd1
commit
b4369bdcd0
6 changed files with 77 additions and 21 deletions
|
@ -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)
|
||||
|
|
|
@ -61,6 +61,21 @@ class RegistrarTest < ActiveSupport::TestCase
|
|||
end
|
||||
end
|
||||
|
||||
def test_creates_email_verification_in_unicode
|
||||
unicode_email = 'suur@äri.ee'
|
||||
punycode_email = Registrar.unicode_to_punycode(unicode_email)
|
||||
unicode_billing_email = 'billing@äri.ee'
|
||||
punycode_billing_email = Registrar.unicode_to_punycode(unicode_billing_email)
|
||||
|
||||
registrar = valid_registrar
|
||||
registrar.email = punycode_email
|
||||
registrar.billing_email = punycode_billing_email
|
||||
registrar.save
|
||||
|
||||
assert_equal registrar.email_verification.email, unicode_email
|
||||
assert_equal registrar.billing_email_verification.email, unicode_billing_email
|
||||
end
|
||||
|
||||
def test_invalid_without_accounting_customer_code
|
||||
registrar = valid_registrar
|
||||
registrar.accounting_customer_code = ''
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue