Defect #21742 » mail_handler_test.rb.patch
mail_handler_test.rb (working copy) | ||
---|---|---|
578 | 578 |
assert_equal 'd8e8fca2dc0f896fd7cb4cb0031ba249', attachment.digest |
579 | 579 |
end |
580 | 580 | |
581 |
def test_mail_with_attachment_latin2 |
|
582 |
issue = submit_email( |
|
583 |
'ticket_with_text_attachment_iso-8859-2.eml', |
|
584 |
:issue => {:project => 'ecookbook'} |
|
585 |
) |
|
586 |
assert_kind_of Issue, issue |
|
587 |
assert_equal 1, issue.attachments.size |
|
588 |
attachment = issue.attachments.first |
|
589 |
assert_equal 'yourfile.txt', attachment.filename |
|
590 |
assert_equal 19, attachment.filesize |
|
591 |
assert File.exist?(attachment.diskfile) |
|
592 |
assert_equal 19, File.size(attachment.diskfile) |
|
593 |
content = "p\xF8\xEDli\xB9 \xBEluou\xE8k\xFD k\xF9n".force_encoding('CP852') |
|
594 |
assert_equal content, File.read(attachment.diskfile).force_encoding('CP852') |
|
595 |
end |
|
596 | ||
581 | 597 |
def test_multiple_inline_text_parts_should_be_appended_to_issue_description |
582 | 598 |
issue = submit_email('multiple_text_parts.eml', :issue => {:project => 'ecookbook'}) |
583 | 599 |
assert_include 'first', issue.description |