not add empty header/footer to notification emails (#13482)
Contributed by Max Horn. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11721 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -596,6 +596,15 @@ class MailerTest < ActiveSupport::TestCase
|
||||
end
|
||||
end
|
||||
|
||||
def test_layout_should_not_include_empty_emails_header
|
||||
with_settings :emails_header => "", :plain_text_mail => 0 do
|
||||
assert Mailer.test_email(User.find(1)).deliver
|
||||
assert_select_email do
|
||||
assert_select ".header", false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def test_layout_should_include_the_emails_footer
|
||||
with_settings :emails_footer => "*Footer content*" do
|
||||
with_settings :plain_text_mail => 0 do
|
||||
@@ -616,6 +625,23 @@ class MailerTest < ActiveSupport::TestCase
|
||||
end
|
||||
end
|
||||
|
||||
def test_layout_should_include_the_emails_footer
|
||||
with_settings :emails_footer => "" do
|
||||
with_settings :plain_text_mail => 0 do
|
||||
assert Mailer.test_email(User.find(1)).deliver
|
||||
assert_select_email do
|
||||
assert_select ".footer", false
|
||||
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_not_include "\n-- \n", 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 <tag>')
|
||||
mail = last_email
|
||||
|
||||
Reference in New Issue
Block a user