@@ -145,7 +145,7 class MailHandler < ActionMailer::Base | |||||
145 | private |
|
145 | private | |
146 |
|
146 | |||
147 | MESSAGE_ID_RE = %r{^<?redmine\.([a-z0-9_]+)\-(\d+)\.\d+(\.[a-f0-9]+)?@} |
|
147 | MESSAGE_ID_RE = %r{^<?redmine\.([a-z0-9_]+)\-(\d+)\.\d+(\.[a-f0-9]+)?@} | |
148 | ISSUE_REPLY_SUBJECT_RE = %r{\[[^\]]*#(\d+)\]} |
|
148 | ISSUE_REPLY_SUBJECT_RE = %r{\[(?:[^\]]*\s+)?#(\d+)\]} | |
149 | MESSAGE_REPLY_SUBJECT_RE = %r{\[[^\]]*msg(\d+)\]} |
|
149 | MESSAGE_REPLY_SUBJECT_RE = %r{\[[^\]]*msg(\d+)\]} | |
150 |
|
150 | |||
151 | def dispatch |
|
151 | def dispatch |
@@ -680,6 +680,30 class MailHandlerTest < ActiveSupport::TestCase | |||||
680 | assert_equal 'Feature request', journal.issue.tracker.name |
|
680 | assert_equal 'Feature request', journal.issue.tracker.name | |
681 | end |
|
681 | end | |
682 |
|
682 | |||
|
683 | def test_update_issue_should_accept_issue_id_after_space_inside_brackets | |||
|
684 | journal = submit_email('ticket_reply_with_status.eml') do |email| | |||
|
685 | assert email.sub!(/^Subject:.*$/, "Subject: Re: [Feature request #2] Add ingredients categories") | |||
|
686 | end | |||
|
687 | assert journal.is_a?(Journal) | |||
|
688 | assert_equal Issue.find(2), journal.journalized | |||
|
689 | end | |||
|
690 | ||||
|
691 | def test_update_issue_should_accept_issue_id_inside_brackets | |||
|
692 | journal = submit_email('ticket_reply_with_status.eml') do |email| | |||
|
693 | assert email.sub!(/^Subject:.*$/, "Subject: Re: [#2] Add ingredients categories") | |||
|
694 | end | |||
|
695 | assert journal.is_a?(Journal) | |||
|
696 | assert_equal Issue.find(2), journal.journalized | |||
|
697 | end | |||
|
698 | ||||
|
699 | def test_update_issue_should_ignore_bogus_issue_ids_in_subject | |||
|
700 | journal = submit_email('ticket_reply_with_status.eml') do |email| | |||
|
701 | assert email.sub!(/^Subject:.*$/, "Subject: Re: [12345#1][bogus#1][Feature request #2] Add ingredients categories") | |||
|
702 | end | |||
|
703 | assert journal.is_a?(Journal) | |||
|
704 | assert_equal Issue.find(2), journal.journalized | |||
|
705 | end | |||
|
706 | ||||
683 | def test_update_issue_with_attribute_changes |
|
707 | def test_update_issue_with_attribute_changes | |
684 | # This email contains: 'Status: Resolved' |
|
708 | # This email contains: 'Status: Resolved' | |
685 | journal = submit_email('ticket_reply_with_status.eml') |
|
709 | journal = submit_email('ticket_reply_with_status.eml') |
General Comments 0
You need to be logged in to leave comments.
Login now