mirror of
https://github.com/redmine/redmine.git
synced 2025-11-10 15:26:03 +01:00
Better handle html-only emails (#16962).
git-svn-id: http://svn.redmine.org/redmine/trunk@14313 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -797,13 +797,33 @@ class MailHandlerTest < ActiveSupport::TestCase
|
||||
assert_equal Message.find(1), m.parent
|
||||
end
|
||||
|
||||
def test_should_strip_tags_of_html_only_emails
|
||||
issue = submit_email('ticket_html_only.eml', :issue => {:project => 'ecookbook'})
|
||||
def test_should_convert_tags_of_html_only_emails
|
||||
with_settings :text_formatting => 'textile' do
|
||||
issue = submit_email('ticket_html_only.eml', :issue => {:project => 'ecookbook'})
|
||||
assert issue.is_a?(Issue)
|
||||
assert !issue.new_record?
|
||||
issue.reload
|
||||
assert_equal 'HTML email', issue.subject
|
||||
assert_equal "This is a *html-only* email.\r\n\r\nh1. With a title\r\n\r\nand a paragraph.", issue.description
|
||||
end
|
||||
end
|
||||
|
||||
def test_should_handle_outlook_web_access_2010_html_only
|
||||
issue = submit_email('outlook_web_access_2010_html_only.eml', :issue => {:project => 'ecookbook'})
|
||||
assert issue.is_a?(Issue)
|
||||
assert !issue.new_record?
|
||||
issue.reload
|
||||
assert_equal 'HTML email', issue.subject
|
||||
assert_equal 'This is a html-only email.', issue.description
|
||||
assert_equal 'Upgrade Redmine to 3.0.x', issue.subject
|
||||
assert_equal "A mess.\r\n\r\n--Geoff Maciolek\r\nMYCOMPANYNAME, LLC", issue.description
|
||||
end
|
||||
|
||||
def test_should_handle_outlook_2010_html_only
|
||||
issue = submit_email('outlook_2010_html_only.eml', :issue => {:project => 'ecookbook'})
|
||||
assert issue.is_a?(Issue)
|
||||
issue.reload
|
||||
assert_equal 'Test email', issue.subject
|
||||
assert_equal "Simple, unadorned test email generated by Outlook 2010. It is in HTML format, but" +
|
||||
" no special formatting has been chosen. I’m going to save this as a draft and then manually" +
|
||||
" drop it into the Inbox for scraping by Redmine 3.0.2.", issue.description
|
||||
end
|
||||
|
||||
test "truncate emails with no setting should add the entire email into the issue" do
|
||||
|
||||
Reference in New Issue
Block a user