summaryrefslogtreecommitdiffstats
path: root/test/functional/issues_controller_test.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2017-01-18 14:49:57 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2017-01-18 14:49:57 +0000
commit6fabc106964a6e33eb5f0cf779856a6b24451692 (patch)
tree8d0fd29250ca7588c7d8e332c44df4018f486968 /test/functional/issues_controller_test.rb
parent3a21dc6912ab6f0426dc5a59c68c571447bf9bef (diff)
downloadredmine-6fabc106964a6e33eb5f0cf779856a6b24451692.tar.gz
redmine-6fabc106964a6e33eb5f0cf779856a6b24451692.zip
Add warning when loosing data from custom fields when bulk editing issues (#22600).
git-svn-id: http://svn.redmine.org/redmine/trunk@16224 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional/issues_controller_test.rb')
-rw-r--r--test/functional/issues_controller_test.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/functional/issues_controller_test.rb b/test/functional/issues_controller_test.rb
index 2e9a11c42..4e8d88668 100644
--- a/test/functional/issues_controller_test.rb
+++ b/test/functional/issues_controller_test.rb
@@ -4067,6 +4067,23 @@ class IssuesControllerTest < Redmine::ControllerTest
assert_select 'input[name=?]', "issue[custom_field_values][#{field2.id}]"
end
+ def test_bulk_edit_should_warn_about_custom_field_values_about_to_be_cleared
+ CustomField.delete_all
+
+ cleared = IssueCustomField.generate!(:name => 'Cleared', :tracker_ids => [2], :is_for_all => true)
+ CustomValue.create!(:customized => Issue.find(2), :custom_field => cleared, :value => 'foo')
+
+ not_cleared = IssueCustomField.generate!(:name => 'Not cleared', :tracker_ids => [2, 3], :is_for_all => true)
+ CustomValue.create!(:customized => Issue.find(2), :custom_field => not_cleared, :value => 'bar')
+ @request.session[:user_id] = 2
+
+ get :bulk_edit, :ids => [1, 2], :issue => {:tracker_id => 3}
+ assert_response :success
+ assert_select '.warning', :text => /automatic deletion of values/
+ assert_select '.warning span', :text => 'Cleared (1)'
+ assert_select '.warning span', :text => /Not cleared/, :count => 0
+ end
+
def test_bulk_update
@request.session[:user_id] = 2
# update issues priority