mirror of
https://github.com/redmine/redmine.git
synced 2025-11-07 05:45:49 +01:00
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
This commit is contained in:
@@ -54,20 +54,26 @@ class MailHandlerControllerTest < Redmine::ControllerTest
|
|||||||
|
|
||||||
def test_should_create_issue_with_options
|
def test_should_create_issue_with_options
|
||||||
# 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,
|
||||||
|
:mail_handler_api_key => 'secret'
|
||||||
|
) do
|
||||||
assert_difference 'Issue.count' do
|
assert_difference 'Issue.count' do
|
||||||
post(
|
post(
|
||||||
:index,
|
:index,
|
||||||
:params => {
|
:params => {
|
||||||
:key => 'secret',
|
:key => 'secret',
|
||||||
:email => IO.read(File.join(FIXTURES_PATH, 'ticket_on_given_project.eml')),
|
:email =>
|
||||||
|
IO.read(
|
||||||
|
File.join(FIXTURES_PATH, 'ticket_on_given_project.eml')
|
||||||
|
),
|
||||||
:issue => {
|
:issue => {
|
||||||
:is_private => '1'
|
:is_private => '1'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
end
|
||||||
assert_response 201
|
assert_response 201
|
||||||
issue = Issue.order(:id => :desc).first
|
issue = Issue.order(:id => :desc).first
|
||||||
assert_equal true, issue.is_private
|
assert_equal true, issue.is_private
|
||||||
|
|||||||
Reference in New Issue
Block a user