Defect #27691 » 27691-test.patch
| test/fixtures/mail_handler/ticket_with_utf8_body_and_lf_line_terminator.eml | ||
|---|---|---|
|
Return-Path: <jsmith@somenet.foo>
|
||
|
Received: from osiris ([127.0.0.1])
|
||
|
by OSIRIS
|
||
|
with hMailServer ; Sun, 22 Jun 2008 12:28:07 +0200
|
||
|
Message-ID: <000501c8d452$a95cd7e0$0a00a8c0@osiris>
|
||
|
From: "John Smith" <jsmith@somenet.foo>
|
||
|
To: <redmine@somenet.foo>
|
||
|
Subject: New ticket on UTF-8 body and LF line terminator
|
||
|
Date: Sun, 22 Jun 2008 12:28:07 +0200
|
||
|
MIME-Version: 1.0
|
||
|
Content-Type: text/plain;
|
||
|
format=flowed;
|
||
|
charset="utf-8";
|
||
|
reply-type=original
|
||
|
Content-Transfer-Encoding: 8bit
|
||
|
Hello
|
||
|
こんにちは
|
||
| test/unit/mail_handler_test.rb | ||
|---|---|---|
|
assert_equal false, MailHandler.safe_receive
|
||
|
end
|
||
|
def test_add_issue_with_utf8_body_and_lf_line_terminator
|
||
|
issue =
|
||
|
submit_email('ticket_with_utf8_body_and_lf_line_terminator.eml',
|
||
|
:issue => {:project => 'ecookbook'}
|
||
|
) do |email|
|
||
|
# Ensure that line terminators are LF
|
||
|
email.gsub!("\r\n", "\n")
|
||
|
end
|
||
|
assert issue.is_a?(Issue)
|
||
|
issue.reload
|
||
|
assert_equal 'New ticket on UTF-8 body and LF line terminator', issue.subject
|
||
|
assert_equal "Hello\r\nこんにちは", issue.description
|
||
|
end
|
||
|
private
|
||
|
def submit_email(filename, options={})
|
||