diff options
author | Go MAEDA <maeda@farend.jp> | 2024-07-26 03:19:22 +0000 |
---|---|---|
committer | Go MAEDA <maeda@farend.jp> | 2024-07-26 03:19:22 +0000 |
commit | fded8025d577baf1f1003d8e6b9f64606f2a798b (patch) | |
tree | 4aa8704a9878c7d2b9a160ed26eb3286b703285e /test | |
parent | acd1e2def892154dddf5c5c1563453bff1fdd188 (diff) | |
download | redmine-fded8025d577baf1f1003d8e6b9f64606f2a798b.tar.gz redmine-fded8025d577baf1f1003d8e6b9f64606f2a798b.zip |
Add project identifier to List-Id header in notification emails (#13359).
Patch by Go MAEDA (user:maeda).
git-svn-id: https://svn.redmine.org/redmine/trunk@22944 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r-- | test/unit/mailer_test.rb | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/test/unit/mailer_test.rb b/test/unit/mailer_test.rb index 0506e27d2..2cb5c4ca4 100644 --- a/test/unit/mailer_test.rb +++ b/test/unit/mailer_test.rb @@ -212,15 +212,11 @@ class MailerTest < ActiveSupport::TestCase end def test_email_headers - with_settings :mail_from => 'Redmine <redmine@example.net>' do - issue = Issue.find(1) - Mailer.deliver_issue_add(issue) - end + issue = Issue.find(1) + Mailer.deliver_issue_add(issue) mail = last_email assert_equal 'All', mail.header['X-Auto-Response-Suppress'].to_s assert_equal 'auto-generated', mail.header['Auto-Submitted'].to_s - # List-Id should not include the display name "Redmine" - assert_equal '<redmine.example.net>', mail.header['List-Id'].to_s assert_equal 'Bug', mail.header['X-Redmine-Issue-Tracker'].to_s assert_equal 'Low', mail.header['X-Redmine-Issue-Priority'].to_s end @@ -327,6 +323,23 @@ class MailerTest < ActiveSupport::TestCase end end + def test_list_id_header_should_include_project_identifier + with_settings :mail_from => 'Redmine <redmine@example.net>' do + content = WikiContent.find(1) + Mailer.deliver_wiki_content_added(content) + mail = last_email + assert_equal '<ecookbook.redmine.example.net>', mail.header['List-Id'].to_s + end + end + + def test_list_id_header_excludes_project_identifier_for_non_project_emails + with_settings :mail_from => 'Redmine <redmine@example.net>' do + Mailer.deliver_test_email(User.find(1)) + mail = last_email + assert_equal '<redmine.example.net>', mail.header['List-Id'].to_s + end + end + def test_should_not_send_email_without_recipient news = News.first user = news.author |