Browse Source

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
tags/2.2.0
Toshi MARUYAMA 11 years ago
parent
commit
1da74009cd
2 changed files with 18 additions and 0 deletions
  1. 7
    0
      test/fixtures/mail_handler/subject_japanese_1.eml
  2. 11
    0
      test/unit/mail_handler_test.rb

+ 7
- 0
test/fixtures/mail_handler/subject_japanese_1.eml View File

@@ -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

+ 11
- 0
test/unit/mail_handler_test.rb View File

@@ -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!


Loading…
Cancel
Save