From e0e8c14c2aefd58267f7676b0342f04a37b08185 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Fri, 12 Nov 2010 11:34:53 +0000 Subject: Makes MailHandler accept all issue attributes and custom fields that can be set/updated (#4071, #4807, #5622, #6110). git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4394 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- test/fixtures/mail_handler/ticket_on_given_project.eml | 3 +++ test/fixtures/mail_handler/ticket_reply_with_status.eml | 1 + test/unit/mail_handler_test.rb | 5 +++++ 3 files changed, 9 insertions(+) (limited to 'test') diff --git a/test/fixtures/mail_handler/ticket_on_given_project.eml b/test/fixtures/mail_handler/ticket_on_given_project.eml index cfc90b534..39790f287 100644 --- a/test/fixtures/mail_handler/ticket_on_given_project.eml +++ b/test/fixtures/mail_handler/ticket_on_given_project.eml @@ -54,4 +54,7 @@ Status: Resolved due date: 2010-12-31 Start Date:2010-01-01 Assigned to: John Smith +fixed version: alpha +estimated hours: 2.5 +done ratio: 30 diff --git a/test/fixtures/mail_handler/ticket_reply_with_status.eml b/test/fixtures/mail_handler/ticket_reply_with_status.eml index e7d68c3db..66ca730ac 100644 --- a/test/fixtures/mail_handler/ticket_reply_with_status.eml +++ b/test/fixtures/mail_handler/ticket_reply_with_status.eml @@ -29,6 +29,7 @@ Status: Resolved due date: 2010-12-31 Start Date:2010-01-01 Assigned to: jsmith@somenet.foo +searchable field: Updated custom value ------=_NextPart_000_0067_01C8D3CE.711F9CC0 Content-Type: text/html; diff --git a/test/unit/mail_handler_test.rb b/test/unit/mail_handler_test.rb index e59d78be9..ac8e10433 100644 --- a/test/unit/mail_handler_test.rb +++ b/test/unit/mail_handler_test.rb @@ -30,6 +30,7 @@ class MailHandlerTest < ActiveSupport::TestCase :workflows, :trackers, :projects_trackers, + :versions, :enumerations, :issue_categories, :custom_fields, @@ -59,6 +60,9 @@ class MailHandlerTest < ActiveSupport::TestCase assert_equal '2010-01-01', issue.start_date.to_s assert_equal '2010-12-31', issue.due_date.to_s assert_equal User.find_by_login('jsmith'), issue.assigned_to + assert_equal Version.find_by_name('alpha'), issue.fixed_version + assert_equal 2.5, issue.estimated_hours + assert_equal 30, issue.done_ratio # keywords should be removed from the email body assert !issue.description.match(/^Project:/i) assert !issue.description.match(/^Status:/i) @@ -269,6 +273,7 @@ class MailHandlerTest < ActiveSupport::TestCase assert_equal '2010-01-01', issue.start_date.to_s assert_equal '2010-12-31', issue.due_date.to_s assert_equal User.find_by_login('jsmith'), issue.assigned_to + assert_equal 'Updated custom value', issue.custom_value_for(CustomField.find_by_name('Searchable field')).value end def test_add_issue_note_should_send_email_notification -- cgit v1.2.3