Improved test coverage (closes #7571) [joost]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7545 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
上级 39b77ca3
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册