summaryrefslogtreecommitdiffstats
path: root/test/unit/mail_handler_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/unit/mail_handler_test.rb')
-rw-r--r--test/unit/mail_handler_test.rb30
1 files changed, 25 insertions, 5 deletions
diff --git a/test/unit/mail_handler_test.rb b/test/unit/mail_handler_test.rb
index 99900666d..4fc710ba2 100644
--- a/test/unit/mail_handler_test.rb
+++ b/test/unit/mail_handler_test.rb
@@ -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)
+ issue.reload
+ 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)
- assert !issue.new_record?
issue.reload
- assert_equal 'HTML email', issue.subject
- assert_equal 'This is a html-only email.', issue.description
+ 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