]> source.dussan.org Git - redmine.git/commitdiff
Additional tests for email From header (#9564).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Mon, 14 Nov 2011 20:10:06 +0000 (20:10 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Mon, 14 Nov 2011 20:10:06 +0000 (20:10 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@7807 e93f8b46-1217-0410-a6f0-8f06a7374b81

test/unit/mailer_test.rb

index 671b7df2091dd54c3b4c458e7b4bce7a0a565c79..c819d272fc5b792a7301d89f277e970c24265e98 100644 (file)
@@ -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