Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Improved test coverage (closes #7571) [joost]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7545 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
commit 6203d4574ca744215094bec97c5786bd047236d5 1 parent 39b77ca
@dhh dhh authored
Showing with 19 additions and 0 deletions.
  1. +19 −0 actionmailer/test/mail_service_test.rb
View
19 actionmailer/test/mail_service_test.rb
@@ -245,6 +245,14 @@ def custom_content_type_attributes
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 @@ def test_custom_content_type_attributes
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
Please sign in to comment.
Something went wrong with that request. Please try again.