diff options
author | Go MAEDA <maeda@farend.jp> | 2021-05-18 05:18:23 +0000 |
---|---|---|
committer | Go MAEDA <maeda@farend.jp> | 2021-05-18 05:18:23 +0000 |
commit | 97c2607da4606605e2c12b775d5cdb75be32dbc2 (patch) | |
tree | 36a75154b23170ef62de4fdd0a63cf19feebc11f /test/unit/mailer_test.rb | |
parent | 2115569e83006c0f41152b80f49220c3fc180506 (diff) | |
download | redmine-97c2607da4606605e2c12b775d5cdb75be32dbc2.tar.gz redmine-97c2607da4606605e2c12b775d5cdb75be32dbc2.zip |
X-Redmine-Issue-Assignee email header field is empty when the assignee of an issue is a group (#35017).
Patch by Akihiro MATOBA.
git-svn-id: http://svn.redmine.org/redmine/trunk@21005 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/mailer_test.rb')
-rw-r--r-- | test/unit/mailer_test.rb | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/test/unit/mailer_test.rb b/test/unit/mailer_test.rb index b25e17427..da12788f8 100644 --- a/test/unit/mailer_test.rb +++ b/test/unit/mailer_test.rb @@ -219,6 +219,33 @@ class MailerTest < ActiveSupport::TestCase assert_equal issue.author.login, mail.header['X-Redmine-Sender'].to_s end + def test_email_headers_should_not_include_assignee_when_not_assigned + issue = Issue.find(6) + issue.init_journal(User.current) + issue.update(:status_id => 4) + issue.update(:assigned_to_id => nil) + mail = last_email + assert_not mail.header['X-Redmine-Issue-Assignee'] + end + + def test_email_headers_should_include_assignee_when_assigned + issue = Issue.find(6) + issue.init_journal(User.current) + issue.update(:assigned_to_id => 2) + mail = last_email + assert_equal 'jsmith', mail.header['X-Redmine-Issue-Assignee'].to_s + end + + def test_email_headers_should_include_assignee_if_assigned_to_group + issue = Issue.find(6) + with_settings :issue_group_assignment => 1 do + issue.init_journal(User.current) + issue.update(:assigned_to_id => 10) + end + mail = last_email + assert_equal 'Group (A Team)', mail.header['X-Redmine-Issue-Assignee'].to_s + end + def test_plain_text_mail Setting.plain_text_mail = 1 journal = Journal.find(2) |