Adds a test with Japanese keywords in a ISO-2002-JP encoded email (#4576).

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3322 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2010-01-17 11:00:54 +00:00
parent 9c7438aac6
commit bddf3b5c2c
2 changed files with 68 additions and 0 deletions

View File

@ -0,0 +1,60 @@
Message-ID: <001101ca9762$293d68c0$0600a8c0@osiris>
From: "jsmith" <jsmith@somenet.foo>
To: <redmine@somenet.foo>
Subject: Japanese Character pattern matching
Date: Sun, 17 Jan 2010 11:45:18 +0100
MIME-Version: 1.0
Content-Type: multipart/alternative;
boundary="----=_NextPart_000_000E_01CA976A.8AF5E9E0"
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 6.00.2900.2869
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2869
This is a multi-part message in MIME format.
------=_NextPart_000_000E_01CA976A.8AF5E9E0
Content-Type: text/plain;
charset="iso-2022-jp"
Content-Transfer-Encoding: quoted-printable
It should be noted that I am receiving emails using pop and the patch in =
Issue #2420 but I don't think the problem lies with this.
When I try and send emails to the redmine server with Japanese =
characters in them it appears to work apart from the pattern matching.
For example if I send an email with the following keywords.
Tracker: =1B$B3+H/=1B(B
------=_NextPart_000_000E_01CA976A.8AF5E9E0
Content-Type: text/html;
charset="iso-2022-jp"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Diso-2022-jp" =
http-equiv=3DContent-Type>
<META name=3DGENERATOR content=3D"MSHTML 8.00.6001.18702">
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT size=3D2 face=3DArial>
<P>It should be noted that I am receiving emails using pop and the patch =
in=20
Issue <A class=3D"issue status-1 priority-2"=20
title=3D"Fetching emails from an POP server (New)"=20
href=3D"http://www.redmine.org/issues/2420">#2420</A> but I don't think =
the=20
problem lies with this.</P>
<P>When I try and send emails to the redmine server with Japanese =
characters in=20
them it appears to work apart from the pattern matching.</P>
<P>For example if I send an email with the following keywords.</P>
<P>Tracker: =
=1B$B3+H/=1B(B</P></FONT></DIV></BODY></HTML>
------=_NextPart_000_000E_01CA976A.8AF5E9E0--

View File

@ -209,6 +209,14 @@ class MailHandlerTest < ActiveSupport::TestCase
Role.anonymous.add_permission!(:add_issues)
assert_equal false, submit_email('ticket_without_from_header.eml')
end
def test_add_issue_with_japanese_keywords
tracker = Tracker.create!(:name => '開発')
Project.find(1).trackers << tracker
issue = submit_email('japanese_keywords_iso_2022_jp.eml', :issue => {:project => 'ecookbook'}, :allow_override => 'tracker')
assert_kind_of Issue, issue
assert_equal tracker, issue.tracker
end
def test_should_ignore_emails_from_emission_address
Role.anonymous.add_permission!(:add_issues)