diff options
author | Marius Balteanu <marius.balteanu@zitec.com> | 2021-08-05 23:41:01 +0000 |
---|---|---|
committer | Marius Balteanu <marius.balteanu@zitec.com> | 2021-08-05 23:41:01 +0000 |
commit | 7e2f3352dbebb799fef78fe9c7c58cc367e20a88 (patch) | |
tree | 7ec0c9ce72ccb35e7a7780c7244d08318d81db0f /test/functional | |
parent | 764228370c71a78665f8bc5727820dfbc6352e4a (diff) | |
download | redmine-7e2f3352dbebb799fef78fe9c7c58cc367e20a88.tar.gz redmine-7e2f3352dbebb799fef78fe9c7c58cc367e20a88.zip |
Fix that updating an issue from context menu to a none value do not set the field to blank (#33521).
Patch by Mizuki ISHIKAWA.
git-svn-id: http://svn.redmine.org/redmine/trunk@21139 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional')
-rw-r--r-- | test/functional/issues_controller_test.rb | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/test/functional/issues_controller_test.rb b/test/functional/issues_controller_test.rb index 36d906fd2..9e77fed12 100644 --- a/test/functional/issues_controller_test.rb +++ b/test/functional/issues_controller_test.rb @@ -6660,6 +6660,33 @@ class IssuesControllerTest < Redmine::ControllerTest assert_equal 2, issue.reload.assigned_to_id end + def test_update_with_value_of_none_should_set_the_values_to_blank + @request.session[:user_id] = 2 + issue = Issue.find(1) + issue.custom_field_values = {1 => 'MySQL'} + issue.assigned_to_id = 2 + issue.save! + + put( + :update, + params: { + id: issue.id, + issue: { + assigned_to_id: 'none', + category_id: 'none', + fixed_version_id: 'none', + custom_field_values: { 1 => '__none__' } + } + } + ) + + issue.reload + assert_nil issue.assigned_to + assert_nil issue.category + assert_nil issue.fixed_version + assert_equal '', issue.custom_field_value(1) + end + def test_get_bulk_edit @request.session[:user_id] = 2 get(:bulk_edit, :params => {:ids => [1, 3]}) |