Merged r22792 from trunk to 5.1-stable (#40410).

git-svn-id: https://svn.redmine.org/redmine/branches/5.1-stable@22798 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Marius Balteanu
2024-04-29 19:18:04 +00:00
parent 64a0182b9c
commit f339b189ab
2 changed files with 19 additions and 1 deletions

View File

@@ -4778,6 +4778,24 @@ class IssuesControllerTest < Redmine::ControllerTest
assert_select 'input[name=?][value="8"][checked=checked]', 'issue[watcher_user_ids][]'
end
def test_post_create_with_failure_should_not_dereference_group_watchers
@request.session[:user_id] = 1
post(
:create,
:params => {
:project_id => 5,
:issue => {
:tracker_id => 1,
:watcher_user_ids => ['11']
}
}
)
assert_response :success
assert_select 'input[name=?][value="8"][checked=checked]', 'issue[watcher_user_ids][]', 0
assert_select 'input[name=?][value="11"][checked=checked]', 'issue[watcher_user_ids][]', 1
end
def test_post_create_should_ignore_non_safe_attributes
@request.session[:user_id] = 2
assert_nothing_raised do