aboutsummaryrefslogtreecommitdiffstats
path: root/actionmailer/test
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2007-09-22 17:32:39 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2007-09-22 17:32:39 +0000
commit6203d4574ca744215094bec97c5786bd047236d5 (patch)
tree6e136c2ee8980db8b731b34b2556fc28a659acdd /actionmailer/test
parent39b77ca347db1824b0cb6bfb433e5b772f23906f (diff)
downloadrails-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/test')
-rwxr-xr-xactionmailer/test/mail_service_test.rb19
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