From b5d80456acd2bed63e4c18c873b381a161998989 Mon Sep 17 00:00:00 2001 From: Toshi MARUYAMA Date: Tue, 18 Feb 2014 23:21:41 +0000 Subject: [PATCH] add test of gmail ISO-8859-2 mail receiving (#16122) git-svn-id: http://svn.redmine.org/redmine/trunk@12903 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- test/fixtures/mail_handler/gmail-iso8859-2.eml | 11 +++++++++++ test/unit/mail_handler_test.rb | 11 +++++++++++ 2 files changed, 22 insertions(+) create mode 100644 test/fixtures/mail_handler/gmail-iso8859-2.eml diff --git a/test/fixtures/mail_handler/gmail-iso8859-2.eml b/test/fixtures/mail_handler/gmail-iso8859-2.eml new file mode 100644 index 000000000..4a8f844e0 --- /dev/null +++ b/test/fixtures/mail_handler/gmail-iso8859-2.eml @@ -0,0 +1,11 @@ +Date: Tue, 13 Aug 2013 10:56:04 +0700 +From: John Smith +Subject: =?ISO-8859-2?Q?Nikad_vi=B9e?= +To: redmine@somenet.foo +Content-Type: text/plain; charset=ISO-8859-2 +Content-Transfer-Encoding: quoted-printable + +Na =B9triku se su=B9i =B9osi=E6. + +--=20 +=B9osi=E6 diff --git a/test/unit/mail_handler_test.rb b/test/unit/mail_handler_test.rb index 09b37e06f..1e0e6847c 100644 --- a/test/unit/mail_handler_test.rb +++ b/test/unit/mail_handler_test.rb @@ -540,6 +540,17 @@ class MailHandlerTest < ActiveSupport::TestCase assert_equal str, issue.description end + def test_gmail_iso8859_2 + issue = submit_email( + 'gmail-iso8859-2.eml', + :issue => {:project => 'ecookbook'} + ) + assert_kind_of Issue, issue + str = "Na \xc5\xa1triku se su\xc5\xa1i \xc5\xa1osi\xc4\x87." + str.force_encoding('UTF-8') if str.respond_to?(:force_encoding) + assert issue.description.include?(str) + end + def test_add_issue_with_japanese_subject issue = submit_email( 'subject_japanese_1.eml',