@@ -25,9 +25,13 hr { | |||
|
25 | 25 | </style> |
|
26 | 26 | </head> |
|
27 | 27 | <body> |
|
28 | <% if Setting.emails_header.present? -%> | |
|
28 | 29 | <span class="header"><%= Redmine::WikiFormatting.to_html(Setting.text_formatting, Setting.emails_header).html_safe %></span> |
|
30 | <% end -%> | |
|
29 | 31 | <%= yield %> |
|
30 | 32 | <hr /> |
|
33 | <% if Setting.emails_footer.present? -%> | |
|
31 | 34 | <span class="footer"><%= Redmine::WikiFormatting.to_html(Setting.text_formatting, Setting.emails_footer).html_safe %></span> |
|
35 | <% end -%> | |
|
32 | 36 | </body> |
|
33 | 37 | </html> |
@@ -1,4 +1,8 | |||
|
1 | <% if Setting.emails_header.present? -%> | |
|
1 | 2 | <%= Setting.emails_header %> |
|
3 | <% end -%> | |
|
2 | 4 | <%= yield %> |
|
5 | <% if Setting.emails_footer.present? -%> | |
|
3 | 6 | -- |
|
4 | 7 | <%= Setting.emails_footer %> |
|
8 | <% end -%> |
@@ -596,6 +596,15 class MailerTest < ActiveSupport::TestCase | |||
|
596 | 596 | end |
|
597 | 597 | end |
|
598 | 598 | |
|
599 | def test_layout_should_not_include_empty_emails_header | |
|
600 | with_settings :emails_header => "", :plain_text_mail => 0 do | |
|
601 | assert Mailer.test_email(User.find(1)).deliver | |
|
602 | assert_select_email do | |
|
603 | assert_select ".header", false | |
|
604 | end | |
|
605 | end | |
|
606 | end | |
|
607 | ||
|
599 | 608 | def test_layout_should_include_the_emails_footer |
|
600 | 609 | with_settings :emails_footer => "*Footer content*" do |
|
601 | 610 | with_settings :plain_text_mail => 0 do |
@@ -616,6 +625,23 class MailerTest < ActiveSupport::TestCase | |||
|
616 | 625 | end |
|
617 | 626 | end |
|
618 | 627 | |
|
628 | def test_layout_should_include_the_emails_footer | |
|
629 | with_settings :emails_footer => "" do | |
|
630 | with_settings :plain_text_mail => 0 do | |
|
631 | assert Mailer.test_email(User.find(1)).deliver | |
|
632 | assert_select_email do | |
|
633 | assert_select ".footer", false | |
|
634 | end | |
|
635 | end | |
|
636 | with_settings :plain_text_mail => 1 do | |
|
637 | assert Mailer.test_email(User.find(1)).deliver | |
|
638 | mail = last_email | |
|
639 | assert_not_nil mail | |
|
640 | assert_not_include "\n-- \n", mail.body.decoded | |
|
641 | end | |
|
642 | end | |
|
643 | end | |
|
644 | ||
|
619 | 645 | def test_should_escape_html_templates_only |
|
620 | 646 | Issue.generate!(:project_id => 1, :tracker_id => 1, :subject => 'Subject with a <tag>') |
|
621 | 647 | mail = last_email |
General Comments 0
You need to be logged in to leave comments.
Login now