Empty email attachments are imported to Redmine, creating broken DB records (#27885).

Patch by Felix Schäfer.

git-svn-id: http://svn.redmine.org/redmine/trunk@17147 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2018-01-07 21:46:58 +00:00
parent 2cb30321a2
commit 4e6b54e33e
3 changed files with 67 additions and 0 deletions

View File

@@ -631,6 +631,14 @@ class MailHandlerTest < ActiveSupport::TestCase
assert_equal content, File.read(attachment.diskfile).force_encoding('CP852')
end
def test_empty_attachment_should_not_be_imported
issue = submit_email(
'ticket_with_empty_attachment.eml',
issue: { project: 'ecookbook' }
)
assert_equal 0, issue.attachments.size
end
def test_multiple_inline_text_parts_should_be_appended_to_issue_description
issue = submit_email('multiple_text_parts.eml', :issue => {:project => 'ecookbook'})
assert_include 'first', issue.description