@@ -138,7 +138,6 class MailHandlerTest < ActiveSupport::TestCase | |||
|
138 | 138 | assert issue.description.include?('Lorem ipsum dolor sit amet, consectetuer adipiscing elit.') |
|
139 | 139 | end |
|
140 | 140 | |
|
141 | ||
|
142 | 141 | def test_add_issue_with_attachment_to_specific_project |
|
143 | 142 | issue = submit_email('ticket_with_attachment.eml', :issue => {:project => 'onlinestore'}) |
|
144 | 143 | assert issue.is_a?(Issue) |
@@ -385,7 +384,6 class MailHandlerTest < ActiveSupport::TestCase | |||
|
385 | 384 | setup do |
|
386 | 385 | Setting.mail_handler_body_delimiters = '---' |
|
387 | 386 | end |
|
388 | ||
|
389 | 387 | should "truncate the email at the delimiter for the issue" do |
|
390 | 388 | issue = submit_email('ticket_on_given_project.eml') |
|
391 | 389 | assert_issue_created(issue) |
@@ -400,39 +398,32 class MailHandlerTest < ActiveSupport::TestCase | |||
|
400 | 398 | setup do |
|
401 | 399 | Setting.mail_handler_body_delimiters = '--- Reply above. Do not remove this line. ---' |
|
402 | 400 | end |
|
403 | ||
|
404 | 401 | should "truncate the email at the delimiter with the quoted reply symbols (>)" do |
|
405 | 402 | journal = submit_email('issue_update_with_quoted_reply_above.eml') |
|
406 | 403 | assert journal.is_a?(Journal) |
|
407 | 404 | assert journal.notes.include?('An update to the issue by the sender.') |
|
408 | 405 | assert !journal.notes.match(Regexp.escape("--- Reply above. Do not remove this line. ---")) |
|
409 | 406 | assert !journal.notes.include?('Looks like the JSON api for projects was missed.') |
|
410 | ||
|
411 | 407 | end |
|
412 | ||
|
413 | 408 | end |
|
414 | 409 | |
|
415 | 410 | context "with multiple quoted replies (e.g. reply to a reply of a Redmine email notification)" do |
|
416 | 411 | setup do |
|
417 | 412 | Setting.mail_handler_body_delimiters = '--- Reply above. Do not remove this line. ---' |
|
418 | 413 | end |
|
419 | ||
|
420 | 414 | should "truncate the email at the delimiter with the quoted reply symbols (>)" do |
|
421 | 415 | journal = submit_email('issue_update_with_multiple_quoted_reply_above.eml') |
|
422 | 416 | assert journal.is_a?(Journal) |
|
423 | 417 | assert journal.notes.include?('An update to the issue by the sender.') |
|
424 | 418 | assert !journal.notes.match(Regexp.escape("--- Reply above. Do not remove this line. ---")) |
|
425 | 419 | assert !journal.notes.include?('Looks like the JSON api for projects was missed.') |
|
426 | ||
|
427 | 420 | end |
|
428 | ||
|
429 | 421 | end |
|
430 | 422 | |
|
431 | 423 | context "with multiple strings" do |
|
432 | 424 | setup do |
|
433 | 425 | Setting.mail_handler_body_delimiters = "---\nBREAK" |
|
434 | 426 | end |
|
435 | ||
|
436 | 427 | should "truncate the email at the first delimiter found (BREAK)" do |
|
437 | 428 | issue = submit_email('ticket_on_given_project.eml') |
|
438 | 429 | assert_issue_created(issue) |
General Comments 0
You need to be logged in to leave comments.
Login now