summaryrefslogtreecommitdiffstats
path: root/test/functional
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-04-06 12:39:51 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-04-06 12:39:51 +0000
commit34016c38bd2dedd8412a155ce5f22754692668e8 (patch)
tree518c801fb13431949c5648f08a139779dca65f3a /test/functional
parent15ff361894ebeb68dba143eefd2be9da43284e1e (diff)
downloadredmine-34016c38bd2dedd8412a155ce5f22754692668e8.tar.gz
redmine-34016c38bd2dedd8412a155ce5f22754692668e8.zip
Merged r9349 from trunk.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/1.4-stable@9354 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional')
-rw-r--r--test/functional/issues_controller_test.rb31
1 files changed, 28 insertions, 3 deletions
diff --git a/test/functional/issues_controller_test.rb b/test/functional/issues_controller_test.rb
index e91acb20c..217d6e68f 100644
--- a/test/functional/issues_controller_test.rb
+++ b/test/functional/issues_controller_test.rb
@@ -2665,7 +2665,7 @@ class IssuesControllerTest < ActionController::TestCase
:attributes => {:name => "issue[custom_field_values][#{field.id}]"},
:children => {
:only => {:tag => 'option'},
- :count => Project.find(1).users.count + 1
+ :count => Project.find(1).users.count + 2 # "no change" + "none" options
}
end
@@ -2681,7 +2681,7 @@ class IssuesControllerTest < ActionController::TestCase
:attributes => {:name => "issue[custom_field_values][#{field.id}]"},
:children => {
:only => {:tag => 'option'},
- :count => Project.find(1).shared_versions.count + 1
+ :count => Project.find(1).shared_versions.count + 2 # "no change" + "none" options
}
end
@@ -2698,7 +2698,7 @@ class IssuesControllerTest < ActionController::TestCase
:attributes => {:name => "issue[custom_field_values][1][]"},
:children => {
:only => {:tag => 'option'},
- :count => 3
+ :count => field.possible_values.size + 1 # "none" options
}
end
@@ -2924,6 +2924,17 @@ class IssuesControllerTest < ActionController::TestCase
assert_equal '777', journal.details.first.value
end
+ def test_bulk_update_custom_field_to_blank
+ @request.session[:user_id] = 2
+ post :bulk_update, :ids => [1, 3], :notes => 'Bulk editing custom field',
+ :issue => {:priority_id => '',
+ :assigned_to_id => '',
+ :custom_field_values => {'1' => '__none__'}}
+ assert_response 302
+ assert_equal '', Issue.find(1).custom_field_value(1)
+ assert_equal '', Issue.find(3).custom_field_value(1)
+ end
+
def test_bulk_update_multi_custom_field
field = CustomField.find(1)
field.update_attribute :multiple, true
@@ -2942,6 +2953,20 @@ class IssuesControllerTest < ActionController::TestCase
assert_nil Issue.find(2).custom_field_value(1)
end
+ def test_bulk_update_multi_custom_field_to_blank
+ field = CustomField.find(1)
+ field.update_attribute :multiple, true
+
+ @request.session[:user_id] = 2
+ post :bulk_update, :ids => [1, 3], :notes => 'Bulk editing multi custom field',
+ :issue => {:priority_id => '',
+ :assigned_to_id => '',
+ :custom_field_values => {'1' => ['__none__']}}
+ assert_response 302
+ assert_equal [''], Issue.find(1).custom_field_value(1)
+ assert_equal [''], Issue.find(3).custom_field_value(1)
+ end
+
def test_bulk_update_unassign
assert_not_nil Issue.find(2).assigned_to
@request.session[:user_id] = 2