summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/fixtures/mail_handler/subject_japanese_1.eml7
-rw-r--r--test/unit/mail_handler_test.rb11
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!