summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2009-01-25 16:04:28 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2009-01-25 16:04:28 +0000
commitbcc9007196828635abf4ce0e0260766241e7b9d5 (patch)
tree943ca3990d80c40f2c556a66105044424151ce3d /test
parente944fc74df201ec73852add5d2513a4258355e5f (diff)
downloadredmine-bcc9007196828635abf4ce0e0260766241e7b9d5.tar.gz
redmine-bcc9007196828635abf4ce0e0260766241e7b9d5.zip
Ability to bulk edit custom fields of type 'list' (#461).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2316 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r--test/functional/issues_controller_test.rb29
1 files changed, 27 insertions, 2 deletions
diff --git a/test/functional/issues_controller_test.rb b/test/functional/issues_controller_test.rb
index b3978c39c..daca0eb41 100644
--- a/test/functional/issues_controller_test.rb
+++ b/test/functional/issues_controller_test.rb
@@ -629,11 +629,36 @@ class IssuesControllerTest < Test::Unit::TestCase
def test_bulk_edit
@request.session[:user_id] = 2
# update issues priority
- post :bulk_edit, :ids => [1, 2], :priority_id => 7, :notes => 'Bulk editing', :assigned_to_id => ''
+ post :bulk_edit, :ids => [1, 2], :priority_id => 7,
+ :assigned_to_id => '',
+ :custom_field_values => {'2' => ''},
+ :notes => 'Bulk editing'
assert_response 302
# check that the issues were updated
assert_equal [7, 7], Issue.find_all_by_id([1, 2]).collect {|i| i.priority.id}
- assert_equal 'Bulk editing', Issue.find(1).journals.find(:first, :order => 'created_on DESC').notes
+
+ issue = Issue.find(1)
+ journal = issue.journals.find(:first, :order => 'created_on DESC')
+ assert_equal '125', issue.custom_value_for(2).value
+ assert_equal 'Bulk editing', journal.notes
+ assert_equal 1, journal.details.size
+ end
+
+ def test_bulk_edit_custom_field
+ @request.session[:user_id] = 2
+ # update issues priority
+ post :bulk_edit, :ids => [1, 2], :priority_id => '',
+ :assigned_to_id => '',
+ :custom_field_values => {'2' => '777'},
+ :notes => 'Bulk editing custom field'
+ assert_response 302
+
+ issue = Issue.find(1)
+ journal = issue.journals.find(:first, :order => 'created_on DESC')
+ assert_equal '777', issue.custom_value_for(2).value
+ assert_equal 1, journal.details.size
+ assert_equal '125', journal.details.first.old_value
+ assert_equal '777', journal.details.first.value
end
def test_bulk_unassign