summaryrefslogtreecommitdiffstats
path: root/test/functional
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2020-11-29 12:48:38 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2020-11-29 12:48:38 +0000
commit6d4414b1cb5ed005645fa7552eb9ef708b53de41 (patch)
tree3edfc7136053189b1a8ec7ca40a9ada644930546 /test/functional
parentb81577a08d59cb51b3ccf6b84c9a485cdf8853a0 (diff)
downloadredmine-6d4414b1cb5ed005645fa7552eb9ef708b53de41.tar.gz
redmine-6d4414b1cb5ed005645fa7552eb9ef708b53de41.zip
use with_settings at MailHandlerControllerTest#test_should_update_issue
git-svn-id: http://svn.redmine.org/redmine/trunk@20517 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional')
-rw-r--r--test/functional/mail_handler_controller_test.rb25
1 files changed, 14 insertions, 11 deletions
diff --git a/test/functional/mail_handler_controller_test.rb b/test/functional/mail_handler_controller_test.rb
index 3b7167900..45dfbace9 100644
--- a/test/functional/mail_handler_controller_test.rb
+++ b/test/functional/mail_handler_controller_test.rb
@@ -81,17 +81,20 @@ class MailHandlerControllerTest < Redmine::ControllerTest
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'))
- }
- )
+ with_settings(
+ :mail_handler_api_enabled => 1,
+ :mail_handler_api_key => 'secret'
+ ) do
+ 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
end
assert_response 201