From c709c5120c5c2362ecf72f86de895c0d46f337af Mon Sep 17 00:00:00 2001 From: Toshi MARUYAMA Date: Thu, 18 Apr 2013 00:29:18 +0000 Subject: [PATCH] extend mail header test to text mail (#13482) git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11719 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- test/unit/mailer_test.rb | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/test/unit/mailer_test.rb b/test/unit/mailer_test.rb index 223422002..31e8ef688 100644 --- a/test/unit/mailer_test.rb +++ b/test/unit/mailer_test.rb @@ -579,12 +579,20 @@ class MailerTest < ActiveSupport::TestCase def test_layout_should_include_the_emails_header with_settings :emails_header => "*Header content*" do - assert Mailer.test_email(User.find(1)).deliver - assert_select_email do - assert_select ".header" do - assert_select "strong", :text => "Header content" + with_settings :plain_text_mail => 0 do + assert Mailer.test_email(User.find(1)).deliver + assert_select_email do + assert_select ".header" do + assert_select "strong", :text => "Header content" + end end end + with_settings :plain_text_mail => 1 do + assert Mailer.test_email(User.find(1)).deliver + mail = last_email + assert_not_nil mail + assert_include "*Header content*", mail.body.decoded + end end end