mirror of
https://github.com/internetee/registry.git
synced 2025-06-11 23:24:48 +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
|
@ -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