summaryrefslogtreecommitdiffstats
path: root/test/unit/mail_handler_test.rb
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2019-03-03 08:17:59 +0000
committerGo MAEDA <maeda@farend.jp>2019-03-03 08:17:59 +0000
commit77f35cb81841b4747ee54862c7ad0dc6b69ab1ca (patch)
tree6983efad7426c93b3a623b2bf4d4199511e0e471 /test/unit/mail_handler_test.rb
parent917f9d9442a90a2734feac41e1ec8c76bc339227 (diff)
downloadredmine-77f35cb81841b4747ee54862c7ad0dc6b69ab1ca.tar.gz
redmine-77f35cb81841b4747ee54862c7ad0dc6b69ab1ca.zip
Option to parse HTML part of multipart (HTML) emails first (#30838).
Patch by Yuichi HARADA. git-svn-id: http://svn.redmine.org/redmine/trunk@17913 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/mail_handler_test.rb')
-rw-r--r--test/unit/mail_handler_test.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/unit/mail_handler_test.rb b/test/unit/mail_handler_test.rb
index 9d7fd6d12..e5d009633 100644
--- a/test/unit/mail_handler_test.rb
+++ b/test/unit/mail_handler_test.rb
@@ -662,6 +662,17 @@ class MailHandlerTest < ActiveSupport::TestCase
assert_equal '', issue.description
end
+ def test_preferred_body_part_setting
+ with_settings :mail_handler_preferred_body_part => 'plain' do
+ issue = submit_email('different_contents_in_text_and_html.eml', :issue => {:project => 'ecookbook'})
+ assert_equal 'The text part.', issue.description
+ end
+ with_settings :mail_handler_preferred_body_part => 'html' do
+ issue = submit_email('different_contents_in_text_and_html.eml', :issue => {:project => 'ecookbook'})
+ assert_equal 'The html part.', issue.description
+ end
+ end
+
def test_attachment_text_part_should_be_added_as_issue_attachment
issue = submit_email('multiple_text_parts.eml', :issue => {:project => 'ecookbook'})
assert_not_include 'Plain text attachment', issue.description