diff options
author | Go MAEDA <maeda@farend.jp> | 2018-10-15 10:00:18 +0000 |
---|---|---|
committer | Go MAEDA <maeda@farend.jp> | 2018-10-15 10:00:18 +0000 |
commit | facb44cb03533aad57b3d982fab692f25c937e9a (patch) | |
tree | 17f2de1beaef0d48e2fdc653ae011d08430222c9 /test/unit/mail_handler_test.rb | |
parent | 88a83228e1c731da8b4aa68d441669f5aec83214 (diff) | |
download | redmine-facb44cb03533aad57b3d982fab692f25c937e9a.tar.gz redmine-facb44cb03533aad57b3d982fab692f25c937e9a.zip |
Ensure that vendor-defined characters in ISO-2022-JP email subject don't break issue's subject (#29442).
Patch by Go MAEDA.
git-svn-id: http://svn.redmine.org/redmine/trunk@17596 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/mail_handler_test.rb')
-rw-r--r-- | test/unit/mail_handler_test.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/unit/mail_handler_test.rb b/test/unit/mail_handler_test.rb index 51219d65e..e63ab0958 100644 --- a/test/unit/mail_handler_test.rb +++ b/test/unit/mail_handler_test.rb @@ -741,6 +741,20 @@ class MailHandlerTest < ActiveSupport::TestCase assert_equal ja, issue.subject end + def test_add_issue_with_iso_2022_jp_ms_subject + # The original subject is "① 丸数字テスト". + # CIRCLED DIGIT ONE character is undefined in ISO-2022-JP but + # defined in some vendor-extended variants such as ISO-2022-JP-MS. + # This test makes sure that mail gem replaces an undefined characters + # with a replacement character instead of breaking the whole subject. + issue = submit_email( + 'subject_japanese_3.eml', + :issue => {:project => 'ecookbook'} + ) + assert_kind_of Issue, issue + assert_match /丸数字テスト/, issue.subject + end + def test_should_ignore_emails_from_locked_users User.find(2).lock! |