diff options
author | Jamis Buck <jamis@37signals.com> | 2005-07-04 16:11:22 +0000 |
---|---|---|
committer | Jamis Buck <jamis@37signals.com> | 2005-07-04 16:11:22 +0000 |
commit | 06052cb34c578879e2e835321eee9b14e76adf9e (patch) | |
tree | faf5162b8dc0cb685ef7df98a3a525eb19411a53 /actionmailer/test | |
parent | 6e7e552b039c66d1ad5251651d01e0ea097163c5 (diff) | |
download | rails-06052cb34c578879e2e835321eee9b14e76adf9e.tar.gz rails-06052cb34c578879e2e835321eee9b14e76adf9e.tar.bz2 rails-06052cb34c578879e2e835321eee9b14e76adf9e.zip |
Avoid adding nil values to mail headers #1392
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1666 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionmailer/test')
-rwxr-xr-x | actionmailer/test/mail_service_test.rb | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/actionmailer/test/mail_service_test.rb b/actionmailer/test/mail_service_test.rb index 85fe3ad69b..f4de8c1894 100755 --- a/actionmailer/test/mail_service_test.rb +++ b/actionmailer/test/mail_service_test.rb @@ -156,7 +156,15 @@ class TestMailer < ActionMailer::Base p.part :content_type => "text/html", :body => "<b>test</b> HTML<br/>\nline #2" end attachment :content_type => "application/octet-stream",:filename => "test.txt", :body => "test abcdefghijklmnopqstuvwxyz" - + end + + def unnamed_attachment(recipient) + recipients recipient + subject "nested multipart" + from "test@example.com" + body "multipart/mixed" + part :content_type => "text/plain", :body => "hullo" + attachment :content_type => "application/octet-stream", :body => "test abcdefghijklmnopqstuvwxyz" end @@ -621,5 +629,11 @@ EOF mail = TMail::Mail.parse(fixture) assert_not_nil mail.from end + + def test_empty_header_values_omitted + result = TestMailer.create_unnamed_attachment(@recipient).encoded + assert_match %r{Content-Type: application/octet-stream[^;]}, result + assert_match %r{Content-Disposition: attachment[^;]}, result + end end |