diff options
Diffstat (limited to 'actionmailer/test')
-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 |