diff options
author | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2020-12-03 13:20:34 +0000 |
---|---|---|
committer | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2020-12-03 13:20:34 +0000 |
commit | 7c292dd23c6067bc5bf7227a6cc6303e43b0341b (patch) | |
tree | 735b52c62f03583833849dc4087ccc749c601abb | |
parent | ba43634aabd42330e9302fac332d9050493e2e49 (diff) | |
download | redmine-7c292dd23c6067bc5bf7227a6cc6303e43b0341b.tar.gz redmine-7c292dd23c6067bc5bf7227a6cc6303e43b0341b.zip |
use with_settings at MailHandlerControllerTest#test_should_not_allow_with_api_disabled
git-svn-id: http://svn.redmine.org/redmine/trunk@20561 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r-- | test/functional/mail_handler_controller_test.rb | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/test/functional/mail_handler_controller_test.rb b/test/functional/mail_handler_controller_test.rb index ba576039d..eb2b1182d 100644 --- a/test/functional/mail_handler_controller_test.rb +++ b/test/functional/mail_handler_controller_test.rb @@ -122,16 +122,20 @@ class MailHandlerControllerTest < Redmine::ControllerTest def test_should_not_allow_with_api_disabled # Disable API - Setting.mail_handler_api_enabled = 0 - Setting.mail_handler_api_key = 'secret' - assert_no_difference 'Issue.count' do - post( - :index, - :params => { - :key => 'secret', - :email => IO.read(File.join(FIXTURES_PATH, 'ticket_on_given_project.eml')) - } - ) + with_settings( + :mail_handler_api_enabled => 0, + :mail_handler_api_key => 'secret' + ) do + assert_no_difference 'Issue.count' do + post( + :index, + :params => { + :key => 'secret', + :email => + IO.read(File.join(FIXTURES_PATH, 'ticket_on_given_project.eml')) + } + ) + end end assert_response 403 assert_include 'Access denied', response.body |