diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2011-11-14 20:10:06 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2011-11-14 20:10:06 +0000 |
commit | 7afb7752867e48bb20587b04b16bc66080fb24f8 (patch) | |
tree | 38edeedda2940334e475f04d3600b5ae99447066 /test/unit/mailer_test.rb | |
parent | 6cd33a48159e48d13945a02664a5b184996859f3 (diff) | |
download | redmine-7afb7752867e48bb20587b04b16bc66080fb24f8.tar.gz redmine-7afb7752867e48bb20587b04b16bc66080fb24f8.zip |
Additional tests for email From header (#9564).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@7807 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/mailer_test.rb')
-rw-r--r-- | test/unit/mailer_test.rb | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/test/unit/mailer_test.rb b/test/unit/mailer_test.rb index 671b7df20..c819d272f 100644 --- a/test/unit/mailer_test.rb +++ b/test/unit/mailer_test.rb @@ -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 |