diff options
author | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2020-12-04 14:00:01 +0000 |
---|---|---|
committer | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2020-12-04 14:00:01 +0000 |
commit | bef2644f88ca8ca0a55e5f9a35a81c1f3948d26d (patch) | |
tree | 28994ed677730736bd273ebfc16f11e537dbcb4c /test | |
parent | 1b111f9389b06e08e6ec4eac17da96763f5656b4 (diff) | |
download | redmine-bef2644f88ca8ca0a55e5f9a35a81c1f3948d26d.tar.gz redmine-bef2644f88ca8ca0a55e5f9a35a81c1f3948d26d.zip |
use with_settings at MailHandlerControllerTest#test_should_not_allow_with_wrong_key
git-svn-id: http://svn.redmine.org/redmine/trunk@20575 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-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 eb2b1182d..89da9c016 100644 --- a/test/functional/mail_handler_controller_test.rb +++ b/test/functional/mail_handler_controller_test.rb @@ -142,16 +142,20 @@ class MailHandlerControllerTest < Redmine::ControllerTest end def test_should_not_allow_with_wrong_key - Setting.mail_handler_api_enabled = 1 - Setting.mail_handler_api_key = 'secret' - assert_no_difference 'Issue.count' do - post( - :index, - :params => { - :key => 'wrong', - :email => IO.read(File.join(FIXTURES_PATH, 'ticket_on_given_project.eml')) - } - ) + with_settings( + :mail_handler_api_enabled => 1, + :mail_handler_api_key => 'secret' + ) do + assert_no_difference 'Issue.count' do + post( + :index, + :params => { + :key => 'wrong', + :email => + IO.read(File.join(FIXTURES_PATH, 'ticket_on_given_project.eml')) + } + ) + end end assert_response 403 assert_include 'Access denied', response.body |