Skip to content

Commit

Permalink
New mail is more intelligent on encoding and decoding
Browse files Browse the repository at this point in the history
  • Loading branch information
mikel committed Apr 11, 2010
1 parent bd89c39 commit 2a793fa
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions actionmailer/test/old_base/mail_service_test.rb
Expand Up @@ -674,7 +674,7 @@ def test_unquote_quoted_printable_subject
EOF
mail = Mail.new(msg)
assert_equal "testing testing \326\244", mail.subject
assert_equal "Subject: testing =?UTF-8?Q?_testing_=D6=A4=?=\r\n", mail[:subject].encoded
assert_equal "Subject: testing testing =?UTF-8?Q?_=D6=A4=?=\r\n", mail[:subject].encoded
end

def test_unquote_7bit_subject
Expand Down Expand Up @@ -863,7 +863,7 @@ def test_multipart_with_mime_version

def test_multipart_with_utf8_subject
mail = TestMailer.multipart_with_utf8_subject(@recipient)
regex = Regexp.escape('Subject: =?UTF-8?Q?Foo_=C3=A1=C3=AB=C3=B4=?= =?UTF-8?Q?_=C3=AE=C3=BC=?=')
regex = Regexp.escape('Subject: Foo =?UTF-8?Q?=C3=A1=C3=AB=C3=B4=?= =?UTF-8?Q?_=C3=AE=C3=BC=?=')
assert_match(/#{regex}/, mail.encoded)
string = "Foo áëô îü"
string.force_encoding('UTF-8') if string.respond_to?(:force_encoding)
Expand All @@ -872,7 +872,7 @@ def test_multipart_with_utf8_subject

def test_implicitly_multipart_with_utf8
mail = TestMailer.implicitly_multipart_with_utf8
regex = Regexp.escape('Subject: =?UTF-8?Q?Foo_=C3=A1=C3=AB=C3=B4=?= =?UTF-8?Q?_=C3=AE=C3=BC=?=')
regex = Regexp.escape('Subject: Foo =?UTF-8?Q?=C3=A1=C3=AB=C3=B4=?= =?UTF-8?Q?_=C3=AE=C3=BC=?=')
assert_match(/#{regex}/, mail.encoded)
string = "Foo áëô îü"
string.force_encoding('UTF-8') if string.respond_to?(:force_encoding)
Expand Down

0 comments on commit 2a793fa

Please sign in to comment.