diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2007-09-22 17:32:39 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2007-09-22 17:32:39 +0000 |
commit | 6203d4574ca744215094bec97c5786bd047236d5 (patch) | |
tree | 6e136c2ee8980db8b731b34b2556fc28a659acdd /actionmailer | |
parent | 39b77ca347db1824b0cb6bfb433e5b772f23906f (diff) | |
download | rails-6203d4574ca744215094bec97c5786bd047236d5.tar.gz rails-6203d4574ca744215094bec97c5786bd047236d5.tar.bz2 rails-6203d4574ca744215094bec97c5786bd047236d5.zip |
Improved test coverage (closes #7571) [joost]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7545 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionmailer')
-rwxr-xr-x | actionmailer/test/mail_service_test.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/actionmailer/test/mail_service_test.rb b/actionmailer/test/mail_service_test.rb index 132a714cb1..58c6d39749 100755 --- a/actionmailer/test/mail_service_test.rb +++ b/actionmailer/test/mail_service_test.rb @@ -245,6 +245,14 @@ class TestMailer < ActionMailer::Base body "testing" end + def return_path + recipients "no.one@nowhere.test" + subject "return path test" + from "some.one@somewhere.test" + body "testing" + headers "return-path" => "another@somewhere.test" + end + class <<self attr_accessor :received_body end @@ -858,6 +866,17 @@ EOF assert_match %r{format=flowed}, mail['content-type'].to_s assert_match %r{charset=utf-8}, mail['content-type'].to_s end + + def test_return_path_with_create + mail = TestMailer.create_return_path + assert_equal "<another@somewhere.test>", mail['return-path'].to_s + end + + def test_return_path_with_deliver + ActionMailer::Base.delivery_method = :smtp + TestMailer.deliver_return_path + assert_match %r{^Return-Path: <another@somewhere.test>}, MockSMTP.deliveries[0][0] + end end end # uses_mocha |