Commit a86539f7 authored by jplang's avatar jplang
Browse files

Additional tests for email From header (#9564).

git-svn-id: https://svn.redmine.org/redmine/trunk@7807 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent 1a46ae6a
......@@ -157,12 +157,22 @@ class MailerTest < ActiveSupport::TestCase
assert mail.encoded.include?('href')
end
def test_mail_from_with_phrase
def test_from_header
with_settings :mail_from => 'redmine@example.net' do
Mailer.deliver_test(User.find(1))
end
mail = ActionMailer::Base.deliveries.last
assert_not_nil mail
assert_equal 'redmine@example.net', mail.from_addrs.first.address
end
def test_from_header_with_phrase
with_settings :mail_from => 'Redmine app <redmine@example.net>' do
Mailer.deliver_test(User.find(1))
end
mail = ActionMailer::Base.deliveries.last
assert_not_nil mail
assert_equal 'redmine@example.net', mail.from_addrs.first.address
assert_equal 'Redmine app', mail.from_addrs.first.name
end
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment