summaryrefslogtreecommitdiffstats
path: root/test/functional/mail_handler_controller_test.rb
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2020-11-22 12:59:34 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2020-11-22 12:59:34 +0000
commit426777a358677235290fc347fde25cdb04e77c9d (patch)
treeabf0484ecb5cbfb2f65332218c4c414b1e19c92a /test/functional/mail_handler_controller_test.rb
parent5fbc65e20b901f916f34ada7895dad42d5afd09f (diff)
downloadredmine-426777a358677235290fc347fde25cdb04e77c9d.tar.gz
redmine-426777a358677235290fc347fde25cdb04e77c9d.zip
use with_settings at MailHandlerControllerTest#test_should_create_issue
git-svn-id: http://svn.redmine.org/redmine/trunk@20477 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional/mail_handler_controller_test.rb')
-rw-r--r--test/functional/mail_handler_controller_test.rb27
1 files changed, 16 insertions, 11 deletions
diff --git a/test/functional/mail_handler_controller_test.rb b/test/functional/mail_handler_controller_test.rb
index e4cdc3e73..2d440452d 100644
--- a/test/functional/mail_handler_controller_test.rb
+++ b/test/functional/mail_handler_controller_test.rb
@@ -32,17 +32,22 @@ class MailHandlerControllerTest < Redmine::ControllerTest
def test_should_create_issue
# 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,
- :params => {
- :key => 'secret',
- :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_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 201
end