From bde3df2bec99103eeb91c4caaf0483aacadccd92 Mon Sep 17 00:00:00 2001 From: Jamis Buck Date: Wed, 6 Jul 2005 09:53:34 +0000 Subject: Correctly normalize newlines in outgoing emails before encoding the body [John Long] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1732 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionmailer/test/mail_service_test.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'actionmailer/test') diff --git a/actionmailer/test/mail_service_test.rb b/actionmailer/test/mail_service_test.rb index accb18fa25..cd8c9539ca 100755 --- a/actionmailer/test/mail_service_test.rb +++ b/actionmailer/test/mail_service_test.rb @@ -146,6 +146,15 @@ class TestMailer < ActionMailer::Base "line #5\n\nline#6\r\n\r\nline #7" end + def various_newlines_multipart(recipient) + recipients recipient + subject "various newlines multipart" + from "test@example.com" + content_type "multipart/alternative" + part :content_type => "text/plain", :body => "line #1\nline #2\rline #3\r\nline #4\r\r" + part :content_type => "text/html", :body => "

line #1

\n

line #2

\r

line #3

\r\n

line #4

\r\r" + end + def nested_multipart(recipient) recipients recipient subject "nested multipart" @@ -597,6 +606,12 @@ EOF "line #5\n\nline#6\n\nline #7", mail.body) end + def test_various_newlines_multipart + mail = TestMailer.create_various_newlines_multipart(@recipient) + assert_equal "line #1\nline #2\nline #3\nline #4\n\n", mail.parts[0].body + assert_equal "

line #1

\n

line #2

\n

line #3

\n

line #4

\n\n", mail.parts[1].body + end + def test_headers_removed_on_smtp_delivery ActionMailer::Base.delivery_method = :smtp TestMailer.deliver_cc_bcc(@recipient) -- cgit v1.2.3