aboutsummaryrefslogtreecommitdiffstats
path: root/actionmailer
diff options
context:
space:
mode:
authorJamis Buck <jamis@37signals.com>2005-11-06 13:41:12 +0000
committerJamis Buck <jamis@37signals.com>2005-11-06 13:41:12 +0000
commitafe75566cc5b634b5756c0aba3edc7874c915941 (patch)
treea52df643d323c5544eda973ba9d90cde215e0e3a /actionmailer
parent37e2085ff11c21c8132557e449ceadd1e600180b (diff)
downloadrails-afe75566cc5b634b5756c0aba3edc7874c915941.tar.gz
rails-afe75566cc5b634b5756c0aba3edc7874c915941.tar.bz2
rails-afe75566cc5b634b5756c0aba3edc7874c915941.zip
Add a new test case to demonstrate that subject headers are being properly encoded for multipart messages
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2893 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionmailer')
-rwxr-xr-xactionmailer/test/mail_service_test.rb20
1 files changed, 20 insertions, 0 deletions
diff --git a/actionmailer/test/mail_service_test.rb b/actionmailer/test/mail_service_test.rb
index e7a8b9c372..c5b2cdec84 100755
--- a/actionmailer/test/mail_service_test.rb
+++ b/actionmailer/test/mail_service_test.rb
@@ -111,6 +111,21 @@ class TestMailer < ActionMailer::Base
end
end
+ def multipart_with_utf8_subject(recipient)
+ recipients recipient
+ subject "Foo áëô îü"
+ from "test@example.com"
+ charset "utf-8"
+
+ part "text/plain" do |p|
+ p.body = "blah"
+ end
+
+ part "text/html" do |p|
+ p.body = "<b>blah</b>"
+ end
+ end
+
def explicitly_multipart_example(recipient, ct=nil)
recipients recipient
subject "multipart example"
@@ -580,6 +595,11 @@ EOF
mail = TestMailer.create_multipart_with_mime_version(@recipient)
assert_equal "1.1", mail.mime_version
end
+
+ def test_multipart_with_utf8_subject
+ mail = TestMailer.create_multipart_with_utf8_subject(@recipient)
+ assert_match(/\nSubject: =\?utf-8\?Q\?Foo_.*?\?=/, mail.encoded)
+ end
def test_explicitly_multipart_messages
mail = TestMailer.create_explicitly_multipart_example(@recipient)