fix receiving mail subject broken which does not begin with encoding name (#12375)

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10812 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Toshi MARUYAMA
2012-11-16 06:19:42 +00:00
parent 1da74009cd
commit 617cb7ac53
3 changed files with 20 additions and 1 deletions
+11
View File
@@ -393,6 +393,17 @@ class MailHandlerTest < ActiveSupport::TestCase
assert_equal ja, issue.subject
end
def test_add_issue_with_mixed_japanese_subject
issue = submit_email(
'subject_japanese_2.eml',
:issue => {:project => 'ecookbook'}
)
assert_kind_of Issue, issue
ja = "Re: \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!