use with_settings at MailHandlerControllerTest#test_should_update_issue

git-svn-id: http://svn.redmine.org/redmine/trunk@20517 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Toshi MARUYAMA
2020-11-29 12:48:38 +00:00
parent b81577a08d
commit 6d4414b1cb

View File

@@ -81,17 +81,20 @@ class MailHandlerControllerTest < Redmine::ControllerTest
def test_should_update_issue def test_should_update_issue
# Enable API and set a key # Enable API and set a key
Setting.mail_handler_api_enabled = 1 with_settings(
Setting.mail_handler_api_key = 'secret' :mail_handler_api_enabled => 1,
assert_no_difference 'Issue.count' do :mail_handler_api_key => 'secret'
assert_difference 'Journal.count' do ) do
post( assert_no_difference 'Issue.count' do
:index, assert_difference 'Journal.count' do
:params => { post(
:key => 'secret', :index,
:email => IO.read(File.join(FIXTURES_PATH, 'ticket_reply.eml')) :params => {
} :key => 'secret',
) :email => IO.read(File.join(FIXTURES_PATH, 'ticket_reply.eml'))
}
)
end
end end
end end
assert_response 201 assert_response 201