From 9fea2ab6d2242261cbb565c808c20df6a36ed831 Mon Sep 17 00:00:00 2001 From: Toshi MARUYAMA Date: Thu, 18 Apr 2013 00:29:29 +0000 Subject: [PATCH] add mail footer test (#13482) git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11720 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- test/unit/mailer_test.rb | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/test/unit/mailer_test.rb b/test/unit/mailer_test.rb index 31e8ef688..fff0113c6 100644 --- a/test/unit/mailer_test.rb +++ b/test/unit/mailer_test.rb @@ -596,6 +596,26 @@ class MailerTest < ActiveSupport::TestCase end end + def test_layout_should_include_the_emails_footer + with_settings :emails_footer => "*Footer content*" do + with_settings :plain_text_mail => 0 do + assert Mailer.test_email(User.find(1)).deliver + assert_select_email do + assert_select ".footer" do + assert_select "strong", :text => "Footer 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 "\n-- \n", mail.body.decoded + assert_include "*Footer content*", mail.body.decoded + end + end + end + def test_should_escape_html_templates_only Issue.generate!(:project_id => 1, :tracker_id => 1, :subject => 'Subject with a ') mail = last_email