aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/test/template
diff options
context:
space:
mode:
authorAngel N. Sciortino <contact@angeliccomputing.com>2013-09-24 13:42:06 -0500
committerAngel N. Sciortino <contact@angeliccomputing.com>2013-09-24 13:42:06 -0500
commit8ae80447262020e3ff5eda2e5f5bf73bd432b300 (patch)
tree60329a342e5e9912193faed41e8a1123ccaededa /actionview/test/template
parentb1178aef3b44bd9e0153d2c4f8a2a2a590949999 (diff)
downloadrails-8ae80447262020e3ff5eda2e5f5bf73bd432b300.tar.gz
rails-8ae80447262020e3ff5eda2e5f5bf73bd432b300.tar.bz2
rails-8ae80447262020e3ff5eda2e5f5bf73bd432b300.zip
Use the given name in html_options for the hidden field in collection_check_boxes
Diffstat (limited to 'actionview/test/template')
-rw-r--r--actionview/test/template/form_collections_helper_test.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/actionview/test/template/form_collections_helper_test.rb b/actionview/test/template/form_collections_helper_test.rb
index b56847396d..d28e4aeb48 100644
--- a/actionview/test/template/form_collections_helper_test.rb
+++ b/actionview/test/template/form_collections_helper_test.rb
@@ -179,6 +179,13 @@ class FormCollectionsHelperTest < ActionView::TestCase
assert_select "input[type=hidden][name='user[category_ids][]'][value=]", :count => 1
end
+ test 'collection check boxes generates a hidden field using the given :name in :html_options' do
+ collection = [Category.new(1, 'Category 1'), Category.new(2, 'Category 2')]
+ with_collection_check_boxes :user, :category_ids, collection, :id, :name, {}, {name: "user[other_category_ids][]"}
+
+ assert_select "input[type=hidden][name='user[other_category_ids][]'][value=]", :count => 1
+ end
+
test 'collection check boxes accepts a collection and generate a serie of checkboxes with labels for label method' do
collection = [Category.new(1, 'Category 1'), Category.new(2, 'Category 2')]
with_collection_check_boxes :user, :category_ids, collection, :id, :name