From 07fa63c22229e9556a6c6df7e81ec26be1338d49 Mon Sep 17 00:00:00 2001 From: Holger Just Date: Wed, 20 Aug 2014 18:16:03 +0200 Subject: [PATCH 2/2] Add test for trailing unicode whitespace after email body delimiters --- test/fixtures/mail_handler/ticket_on_given_project.eml | 6 +++--- test/unit/mail_handler_test.rb | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/fixtures/mail_handler/ticket_on_given_project.eml b/test/fixtures/mail_handler/ticket_on_given_project.eml index 5e6d911..aa2e5fa 100644 --- a/test/fixtures/mail_handler/ticket_on_given_project.eml +++ b/test/fixtures/mail_handler/ticket_on_given_project.eml @@ -10,9 +10,9 @@ Date: Sun, 22 Jun 2008 12:28:07 +0200 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; - charset="iso-8859-1"; + charset="utf-8"; reply-type=original -Content-Transfer-Encoding: 7bit +Content-Transfer-Encoding: quoted-printable X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.2869 @@ -38,7 +38,7 @@ BREAK This paragraph is between delimiters. ---- +---=C2=A0 This paragraph is after the delimiter so it shouldn't appear. diff --git a/test/unit/mail_handler_test.rb b/test/unit/mail_handler_test.rb index 6c3aefc..ee7c91c 100644 --- a/test/unit/mail_handler_test.rb +++ b/test/unit/mail_handler_test.rb @@ -795,7 +795,7 @@ class MailHandlerTest < ActiveSupport::TestCase assert_issue_created(issue) assert issue.description.include?('This paragraph is before delimiters') assert issue.description.include?('--- This line starts with a delimiter') - assert !issue.description.match(/^---$/) + assert !issue.description.match(/^---#{"\u00A0"}$/) assert !issue.description.include?('This paragraph is after the delimiter') end end -- 2.0.0