summaryrefslogtreecommitdiffstats
path: root/test/functional/mail_handler_controller_test.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2015-05-10 09:07:36 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2015-05-10 09:07:36 +0000
commitd640f7b249b92fe98eff5727bc635a6fd65598bd (patch)
treef4c24783cd3b60fa2d56dbe569ffcaf373c00f06 /test/functional/mail_handler_controller_test.rb
parentf8a9a78ecfa50d53ca8416d296af8a02da8eb7d7 (diff)
downloadredmine-d640f7b249b92fe98eff5727bc635a6fd65598bd.tar.gz
redmine-d640f7b249b92fe98eff5727bc635a6fd65598bd.zip
Adds private issue option to receiving emails (#8424).
git-svn-id: http://svn.redmine.org/redmine/trunk@14262 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional/mail_handler_controller_test.rb')
-rw-r--r--test/functional/mail_handler_controller_test.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/functional/mail_handler_controller_test.rb b/test/functional/mail_handler_controller_test.rb
index 3487d5eb2..a966b774d 100644
--- a/test/functional/mail_handler_controller_test.rb
+++ b/test/functional/mail_handler_controller_test.rb
@@ -38,6 +38,21 @@ class MailHandlerControllerTest < ActionController::TestCase
assert_response 201
end
+ def test_should_create_issue_with_options
+ # Enable API and set a key
+ Setting.mail_handler_api_enabled = 1
+ Setting.mail_handler_api_key = 'secret'
+
+ assert_difference 'Issue.count' do
+ post :index, :key => 'secret',
+ :email => IO.read(File.join(FIXTURES_PATH, 'ticket_on_given_project.eml')),
+ :issue => {:is_private => '1'}
+ end
+ assert_response 201
+ issue = Issue.order(:id => :desc).first
+ assert_equal true, issue.is_private
+ end
+
def test_should_respond_with_422_if_not_created
Project.find('onlinestore').destroy