diff options
author | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2012-11-16 05:25:18 +0000 |
---|---|---|
committer | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2012-11-16 05:25:18 +0000 |
commit | 1da74009cd3f7f39de5f1b50fbb0ce3eb80a6f44 (patch) | |
tree | 186c22e43a6882ee90105ef08bc050a5d9a4542a /test | |
parent | 8b527ce24783acafa0c3148b1c45ea0251fae2d0 (diff) | |
download | redmine-1da74009cd3f7f39de5f1b50fbb0ce3eb80a6f44.tar.gz redmine-1da74009cd3f7f39de5f1b50fbb0ce3eb80a6f44.zip |
add test of receiving mail subject begins with encoding name (#12375)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10811 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r-- | test/fixtures/mail_handler/subject_japanese_1.eml | 7 | ||||
-rw-r--r-- | test/unit/mail_handler_test.rb | 11 |
2 files changed, 18 insertions, 0 deletions
diff --git a/test/fixtures/mail_handler/subject_japanese_1.eml b/test/fixtures/mail_handler/subject_japanese_1.eml new file mode 100644 index 000000000..ee93a68ba --- /dev/null +++ b/test/fixtures/mail_handler/subject_japanese_1.eml @@ -0,0 +1,7 @@ +From: John Smith <JSmith@somenet.foo> +To: "redmine@somenet.foo" <redmine@somenet.foo> +Subject: =?iso-2022-jp?b?GyRCJUYlOSVIGyhCCg=?= +Date: Fri, 1 Jun 2012 14:39:38 +0200 +Message-ID: <87C31D42249DD0489D1A1444E3232DD7019D6183@foo.bar> + +Fixture diff --git a/test/unit/mail_handler_test.rb b/test/unit/mail_handler_test.rb index a1e5b8178..7eea11f84 100644 --- a/test/unit/mail_handler_test.rb +++ b/test/unit/mail_handler_test.rb @@ -382,6 +382,17 @@ class MailHandlerTest < ActiveSupport::TestCase assert_equal 'Testmail from Webmail: ä ö ü...', issue.subject end + def test_add_issue_with_japanese_subject + issue = submit_email( + 'subject_japanese_1.eml', + :issue => {:project => 'ecookbook'} + ) + assert_kind_of Issue, issue + ja = "\xe3\x83\x86\xe3\x82\xb9\xe3\x83\x88" + ja.force_encoding('UTF-8') if ja.respond_to?(:force_encoding) + assert_equal ja, issue.subject + end + def test_should_ignore_emails_from_locked_users User.find(2).lock! |