summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2020-11-26 14:47:08 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2020-11-26 14:47:08 +0000
commitbee9ea910adabde6fe34f374092a6e93e1b3f744 (patch)
tree7d4e206827081c30ef3faab83f95086ee3b0fa52 /test
parent98da3afcd29b328ad40293c02d961b5b795bd0ca (diff)
downloadredmine-bee9ea910adabde6fe34f374092a6e93e1b3f744.tar.gz
redmine-bee9ea910adabde6fe34f374092a6e93e1b3f744.zip
use with_settings at MailHandlerControllerTest#test_should_create_issue_with_options
git-svn-id: http://svn.redmine.org/redmine/trunk@20504 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r--test/functional/mail_handler_controller_test.rb30
1 files changed, 18 insertions, 12 deletions
diff --git a/test/functional/mail_handler_controller_test.rb b/test/functional/mail_handler_controller_test.rb
index 2d440452d..3b7167900 100644
--- a/test/functional/mail_handler_controller_test.rb
+++ b/test/functional/mail_handler_controller_test.rb
@@ -54,19 +54,25 @@ class MailHandlerControllerTest < Redmine::ControllerTest
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,
- :params => {
- :key => 'secret',
- :email => IO.read(File.join(FIXTURES_PATH, 'ticket_on_given_project.eml')),
- :issue => {
- :is_private => '1'
+ 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')
+ ),
+ :issue => {
+ :is_private => '1'
+ }
}
- }
- )
+ )
+ end
end
assert_response 201
issue = Issue.order(:id => :desc).first