diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2011-04-29 07:05:41 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2011-04-29 07:05:41 +0000 |
commit | d2bc5a94732d8fc9362172cf0223af12068841da (patch) | |
tree | b369f2e7cb964e90daf1c9e74c5df2cc9ac1fa82 | |
parent | 23e75d87d32a28b9ab5aef7cd80a7980a333bb77 (diff) | |
download | redmine-d2bc5a94732d8fc9362172cf0223af12068841da.tar.gz redmine-d2bc5a94732d8fc9362172cf0223af12068841da.zip |
Merged r5105 from trunk.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/1.1-stable@5570 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r-- | app/models/mail_handler.rb | 3 | ||||
-rw-r--r-- | test/unit/mail_handler_test.rb | 4 |
2 files changed, 6 insertions, 1 deletions
diff --git a/app/models/mail_handler.rb b/app/models/mail_handler.rb index 8f18163c0..23b51472e 100644 --- a/app/models/mail_handler.rb +++ b/app/models/mail_handler.rb @@ -155,9 +155,10 @@ class MailHandler < ActionMailer::Base # ignore CLI-supplied defaults for new issues @@handler_options[:issue].clear - journal = issue.init_journal(user, cleaned_up_text_body) + journal = issue.init_journal(user) issue.safe_attributes = issue_attributes_from_keywords(issue) issue.safe_attributes = {'custom_field_values' => custom_field_values_from_keywords(issue)} + journal.notes = cleaned_up_text_body add_attachments(issue) issue.save! logger.info "MailHandler: issue ##{issue.id} updated by #{user}" if logger && logger.info diff --git a/test/unit/mail_handler_test.rb b/test/unit/mail_handler_test.rb index a9f7b77da..c4cc8edaa 100644 --- a/test/unit/mail_handler_test.rb +++ b/test/unit/mail_handler_test.rb @@ -70,6 +70,7 @@ class MailHandlerTest < ActiveSupport::TestCase # keywords should be removed from the email body assert !issue.description.match(/^Project:/i) assert !issue.description.match(/^Status:/i) + assert !issue.description.match(/^Start Date:/i) # Email notification should be sent mail = ActionMailer::Base.deliveries.last assert_not_nil mail @@ -318,6 +319,9 @@ class MailHandlerTest < ActiveSupport::TestCase assert_equal '2010-12-31', issue.due_date.to_s assert_equal User.find_by_login('jsmith'), issue.assigned_to assert_equal "52.6", issue.custom_value_for(CustomField.find_by_name('Float field')).value + # keywords should be removed from the email body + assert !journal.notes.match(/^Status:/i) + assert !journal.notes.match(/^Start Date:/i) end def test_add_issue_note_should_send_email_notification |