Merged r13593 (#17705).

git-svn-id: http://svn.redmine.org/redmine/branches/2.6-stable@13634 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2014-11-22 10:42:59 +00:00
parent da1247ac65
commit 73edc3f59d
2 changed files with 25 additions and 1 deletions

View File

@@ -145,7 +145,7 @@ class MailHandler < ActionMailer::Base
private
MESSAGE_ID_RE = %r{^<?redmine\.([a-z0-9_]+)\-(\d+)\.\d+(\.[a-f0-9]+)?@}
ISSUE_REPLY_SUBJECT_RE = %r{\[[^\]]*#(\d+)\]}
ISSUE_REPLY_SUBJECT_RE = %r{\[(?:[^\]]*\s+)?#(\d+)\]}
MESSAGE_REPLY_SUBJECT_RE = %r{\[[^\]]*msg(\d+)\]}
def dispatch

View File

@@ -680,6 +680,30 @@ class MailHandlerTest < ActiveSupport::TestCase
assert_equal 'Feature request', journal.issue.tracker.name
end
def test_update_issue_should_accept_issue_id_after_space_inside_brackets
journal = submit_email('ticket_reply_with_status.eml') do |email|
assert email.sub!(/^Subject:.*$/, "Subject: Re: [Feature request #2] Add ingredients categories")
end
assert journal.is_a?(Journal)
assert_equal Issue.find(2), journal.journalized
end
def test_update_issue_should_accept_issue_id_inside_brackets
journal = submit_email('ticket_reply_with_status.eml') do |email|
assert email.sub!(/^Subject:.*$/, "Subject: Re: [#2] Add ingredients categories")
end
assert journal.is_a?(Journal)
assert_equal Issue.find(2), journal.journalized
end
def test_update_issue_should_ignore_bogus_issue_ids_in_subject
journal = submit_email('ticket_reply_with_status.eml') do |email|
assert email.sub!(/^Subject:.*$/, "Subject: Re: [12345#1][bogus#1][Feature request #2] Add ingredients categories")
end
assert journal.is_a?(Journal)
assert_equal Issue.find(2), journal.journalized
end
def test_update_issue_with_attribute_changes
# This email contains: 'Status: Resolved'
journal = submit_email('ticket_reply_with_status.eml')