diff options
author | Jamis Buck <jamis@37signals.com> | 2005-09-01 16:00:08 +0000 |
---|---|---|
committer | Jamis Buck <jamis@37signals.com> | 2005-09-01 16:00:08 +0000 |
commit | 8373b55055f421bb48c375f69d85f6dbbe679649 (patch) | |
tree | 169eeb1fe6977620b1fc6d7d32a69b9e25307866 /actionmailer/test | |
parent | a32251487174dffe420980fbc9d43bcf4472d2af (diff) | |
download | rails-8373b55055f421bb48c375f69d85f6dbbe679649.tar.gz rails-8373b55055f421bb48c375f69d85f6dbbe679649.tar.bz2 rails-8373b55055f421bb48c375f69d85f6dbbe679649.zip |
* Don't add charset to content-type header for a part that contains subparts (for AOL compatibility) #2013 [John Long]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2091 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionmailer/test')
-rwxr-xr-x | actionmailer/test/mail_service_test.rb | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/actionmailer/test/mail_service_test.rb b/actionmailer/test/mail_service_test.rb index c181b14f9a..e7a8b9c372 100755 --- a/actionmailer/test/mail_service_test.rb +++ b/actionmailer/test/mail_service_test.rb @@ -128,13 +128,14 @@ class TestMailer < ActionMailer::Base :body => "123456789" end - def implicitly_multipart_example(recipient, order = nil) + def implicitly_multipart_example(recipient, cs = nil, order = nil) @recipients = recipient @subject = "multipart example" @from = "test@example.com" @sent_on = Time.local 2004, 12, 12 @body = { "recipient" => recipient } - @implicit_parts_order = order unless order.nil? + @charset = cs if cs + @implicit_parts_order = order if order end def html_mail(recipient) @@ -598,8 +599,7 @@ EOF end def test_explicitly_multipart_with_content_type - mail = TestMailer.create_explicitly_multipart_example(@recipient, - "multipart/alternative") + mail = TestMailer.create_explicitly_multipart_example(@recipient, "multipart/alternative") assert_equal 3, mail.parts.length assert_equal "multipart/alternative", mail.content_type end @@ -624,13 +624,23 @@ EOF end def test_implicitly_multipart_messages_with_custom_order - mail = TestMailer.create_implicitly_multipart_example(@recipient, ["text/yaml", "text/plain"]) + mail = TestMailer.create_implicitly_multipart_example(@recipient, nil, ["text/yaml", "text/plain"]) assert_equal 3, mail.parts.length assert_equal "text/html", mail.parts[0].content_type assert_equal "text/plain", mail.parts[1].content_type assert_equal "text/yaml", mail.parts[2].content_type end + def test_implicitly_multipart_messages_with_charset + mail = TestMailer.create_implicitly_multipart_example(@recipient, 'iso-8859-1') + + assert_equal "multipart/alternative", mail.header['content-type'].body + + assert_equal 'iso-8859-1', mail.parts[0].sub_header("content-type", "charset") + assert_equal 'iso-8859-1', mail.parts[1].sub_header("content-type", "charset") + assert_equal 'iso-8859-1', mail.parts[2].sub_header("content-type", "charset") + end + def test_html_mail mail = TestMailer.create_html_mail(@recipient) assert_equal "text/html", mail.content_type |