diff --git a/test/fixtures/mail_handler/ticket_with_mixed_single_and_multi_bytes_subject.eml b/test/fixtures/mail_handler/ticket_with_mixed_single_and_multi_bytes_subject.eml new file mode 100644 index 000000000..e4075a130 --- /dev/null +++ b/test/fixtures/mail_handler/ticket_with_mixed_single_and_multi_bytes_subject.eml @@ -0,0 +1,12 @@ +To: redmine@somenet.foo +From: John Smith +Subject: =?UTF-8?B?W+e3iuaApV1bUkVETUlORV1bV0FSTklORzAxXVByb2JsZW06IOODoQ==?= + =?UTF-8?B?44Oi44Oq5a656YeP44GM6YC86L+r44GX44Gm44GE44G+44GZ?= +Message-ID: <42feb4b3-4dec-7c61-0edd-45dfc4795143@somenet.foo> +Date: Tue, 18 Jun 2019 14:08:06 +0900 +MIME-Version: 1.0 +Content-Type: text/plain; charset=utf-8; format=flowed +Content-Language: en-US +Content-Transfer-Encoding: 7bit + +Problem started at 13:49:27 on 2019.06.18 diff --git a/test/unit/mail_handler_test.rb b/test/unit/mail_handler_test.rb index ed064f6f7..8aab1aabc 100644 --- a/test/unit/mail_handler_test.rb +++ b/test/unit/mail_handler_test.rb @@ -1158,6 +1158,15 @@ class MailHandlerTest < ActiveSupport::TestCase assert_equal 'αβγδεζηθικλμνξοπρςστυφχψω', issue.subject end + def test_email_with_mixed_single_and_multi_bytes_subject + issue = submit_email( + 'ticket_with_mixed_single_and_multi_bytes_subject.eml', + :issue => {:project => 'ecookbook'} + ) + assert issue.is_a?(Issue) + assert_equal '[緊急][REDMINE][WARNING01]Problem: メモリ容量が逼迫しています', issue.subject + end + def test_first_keyword_should_be_matched issue = submit_email('ticket_with_duplicate_keyword.eml', :allow_override => 'priority') assert issue.is_a?(Issue)