summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2019-01-19 10:59:45 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2019-01-19 10:59:45 +0000
commite82e0189384e3516a4e8f6ae6a3801f2b7ab4806 (patch)
tree3d028f154963ee54538534aefe4ed2ee5c1490cc
parent42bb2a42801335a57d79b2715e5cc75a226adf74 (diff)
downloadredmine-e82e0189384e3516a4e8f6ae6a3801f2b7ab4806.tar.gz
redmine-e82e0189384e3516a4e8f6ae6a3801f2b7ab4806.zip
Adding an issue note via email fails due to NoMethodError (#30455).
Patch by Go MAEDA. git-svn-id: http://svn.redmine.org/redmine/trunk@17817 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rwxr-xr-xapp/models/mail_handler.rb2
-rw-r--r--test/functional/mail_handler_controller_test.rb16
2 files changed, 17 insertions, 1 deletions
diff --git a/app/models/mail_handler.rb b/app/models/mail_handler.rb
index 073e0dcc0..9298e1b12 100755
--- a/app/models/mail_handler.rb
+++ b/app/models/mail_handler.rb
@@ -237,7 +237,7 @@ class MailHandler < ActionMailer::Base
end
# ignore CLI-supplied defaults for new issues
- handler_options[:issue].clear
+ handler_options[:issue] = {}
journal = issue.init_journal(user)
if from_journal && from_journal.private_notes?
diff --git a/test/functional/mail_handler_controller_test.rb b/test/functional/mail_handler_controller_test.rb
index 633465471..707373942 100644
--- a/test/functional/mail_handler_controller_test.rb
+++ b/test/functional/mail_handler_controller_test.rb
@@ -60,6 +60,22 @@ class MailHandlerControllerTest < Redmine::ControllerTest
assert_equal true, issue.is_private
end
+ def test_should_update_issue
+ # Enable API and set a key
+ Setting.mail_handler_api_enabled = 1
+ Setting.mail_handler_api_key = 'secret'
+
+ assert_no_difference 'Issue.count' do
+ assert_difference 'Journal.count' do
+ post :index, :params => {
+ :key => 'secret',
+ :email => IO.read(File.join(FIXTURES_PATH, 'ticket_reply.eml'))
+ }
+ end
+ end
+ assert_response 201
+ end
+
def test_should_respond_with_422_if_not_created
Project.find('onlinestore').destroy