mirror of
https://github.com/redmine/redmine.git
synced 2026-01-31 03:40:24 +01:00
Don't use SudoMode.disable! to skip API requests (#19851).
git-svn-id: http://svn.redmine.org/redmine/trunk@14338 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -143,4 +143,19 @@ class SudoTest < Redmine::IntegrationTest
|
||||
assert_equal 'even.newer.mail@test.com', User.find_by_login('jsmith').mail
|
||||
end
|
||||
|
||||
def test_sudo_mode_should_skip_api_requests
|
||||
with_settings :rest_api_enabled => '1' do
|
||||
assert_difference('User.count') do
|
||||
post '/users.json', {
|
||||
:user => {
|
||||
:login => 'foo', :firstname => 'Firstname', :lastname => 'Lastname',
|
||||
:mail => 'foo@example.net', :password => 'secret123',
|
||||
:mail_notification => 'only_assigned'}
|
||||
},
|
||||
credentials('admin')
|
||||
|
||||
assert_response :created
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user