diff options
author | Jamis Buck <jamis@37signals.com> | 2005-08-22 23:53:04 +0000 |
---|---|---|
committer | Jamis Buck <jamis@37signals.com> | 2005-08-22 23:53:04 +0000 |
commit | dca4d4e86d7fa753428d24a8ab33dc08a0401581 (patch) | |
tree | 9af4835126dacf6b8d8fe086207392b5e00f2f7b /actionmailer/test | |
parent | ae1e85200e1480a47db7c3ccfcc7d256f37e88ba (diff) | |
download | rails-dca4d4e86d7fa753428d24a8ab33dc08a0401581.tar.gz rails-dca4d4e86d7fa753428d24a8ab33dc08a0401581.tar.bz2 rails-dca4d4e86d7fa753428d24a8ab33dc08a0401581.zip |
Multipart messages specify a MIME-Version header automatically #2003 [John Long]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2038 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionmailer/test')
-rwxr-xr-x | actionmailer/test/mail_service_test.rb | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/actionmailer/test/mail_service_test.rb b/actionmailer/test/mail_service_test.rb index 97bdcaa1f8..50eb1984b5 100755 --- a/actionmailer/test/mail_service_test.rb +++ b/actionmailer/test/mail_service_test.rb @@ -94,6 +94,23 @@ class TestMailer < ActionMailer::Base @charset = "utf-8" end + def multipart_with_mime_version(recipient) + recipients recipient + subject "multipart with mime_version" + from "test@example.com" + sent_on Time.local(2004, 12, 12) + mime_version "1.1" + content_type "multipart/alternative" + + 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" @@ -239,6 +256,7 @@ class ActionMailerTest < Test::Unit::TestCase expected.body = "Hello there, \n\nMr. #{@recipient}" expected.from = "system@loudthinking.com" expected.date = Time.local(2004, 12, 12) + expected.mime_version = nil created = nil assert_nothing_raised { created = TestMailer.create_signed_up(@recipient) } @@ -552,6 +570,11 @@ EOF assert_nothing_raised { mail.body } end + def test_multipart_with_mime_version + mail = TestMailer.create_multipart_with_mime_version(@recipient) + assert_equal "1.1", mail.mime_version + end + def test_explicitly_multipart_messages mail = TestMailer.create_explicitly_multipart_example(@recipient) assert_equal 3, mail.parts.length @@ -585,6 +608,7 @@ EOF def test_implicitly_multipart_messages mail = TestMailer.create_implicitly_multipart_example(@recipient) assert_equal 3, mail.parts.length + assert_equal "1.0", mail.mime_version assert_equal "multipart/alternative", mail.content_type assert_equal "text/yaml", mail.parts[0].content_type assert_equal "utf-8", mail.parts[0].sub_header("content-type", "charset") |