diff options
author | Marius Balteanu <marius.balteanu@zitec.com> | 2024-04-28 07:12:32 +0000 |
---|---|---|
committer | Marius Balteanu <marius.balteanu@zitec.com> | 2024-04-28 07:12:32 +0000 |
commit | ab2f00f2ebf34931f6fa9e67751535bb6cb0b728 (patch) | |
tree | 12dc6d4a9c8d9a43ee0fa5d8f73cc6cda6ad5446 /test/functional/issues_controller_test.rb | |
parent | f94370962acd7a41330e627325de693f816ccd92 (diff) | |
download | redmine-ab2f00f2ebf34931f6fa9e67751535bb6cb0b728.tar.gz redmine-ab2f00f2ebf34931f6fa9e67751535bb6cb0b728.zip |
Fixes that watcher groups on new issue form get dereferenced on validation error (#40410, #40555).
Patch by Felix Schäfer (@felix) and Kenta Kumojima (@kumojima).
git-svn-id: https://svn.redmine.org/redmine/trunk@22792 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional/issues_controller_test.rb')
-rw-r--r-- | test/functional/issues_controller_test.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/functional/issues_controller_test.rb b/test/functional/issues_controller_test.rb index cce8ddc62..014a2d835 100644 --- a/test/functional/issues_controller_test.rb +++ b/test/functional/issues_controller_test.rb @@ -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 |