mirror of
https://github.com/internetee/registry.git
synced 2025-07-24 19:48:28 +02:00
Encode domain parts of all addresses in mailers as punycode
This commit is contained in:
parent
25d5d12cfe
commit
86b7b1d19f
4 changed files with 46 additions and 7 deletions
|
@ -14,4 +14,22 @@ class ApplicationMailerTest < ActiveSupport::TestCase
|
|||
|
||||
assert_equal ['no-reply@registry.test'], email.from
|
||||
end
|
||||
|
||||
def test_encodes_address_fields_as_punycode
|
||||
mailer = Class.new(ApplicationMailer) do
|
||||
def test
|
||||
# Empty block to avoid template rendering
|
||||
mail(from: 'from@münchen.test', to: 'to@münchen.test', cc: 'cc@münchen.test',
|
||||
bcc: 'bcc@münchen.test') {}
|
||||
end
|
||||
end
|
||||
|
||||
email = mailer.test
|
||||
email.deliver_now
|
||||
|
||||
assert_equal ['from@xn--mnchen-3ya.test'], email.from
|
||||
assert_equal ['to@xn--mnchen-3ya.test'], email.to
|
||||
assert_equal ['cc@xn--mnchen-3ya.test'], email.cc
|
||||
assert_equal ['bcc@xn--mnchen-3ya.test'], email.bcc
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue