diff options
author | Mauro George <maurogot@gmail.com> | 2015-01-05 20:32:33 -0200 |
---|---|---|
committer | Mauro George <maurogot@gmail.com> | 2015-09-24 19:58:21 -0300 |
commit | 578bc4b595ce4c6ef5fb2e688367ae7dc40bf1a5 (patch) | |
tree | 5ac6d7b14f1428fcc8f96ee3053fd3d1822c5095 /actionview/test | |
parent | 491013e06d0ad4a296cc23be6c4a48bb0a98106f (diff) | |
download | rails-578bc4b595ce4c6ef5fb2e688367ae7dc40bf1a5.tar.gz rails-578bc4b595ce4c6ef5fb2e688367ae7dc40bf1a5.tar.bz2 rails-578bc4b595ce4c6ef5fb2e688367ae7dc40bf1a5.zip |
Regression test on CollectionCheckBoxes to accept `include_hidden`
as string
Diffstat (limited to 'actionview/test')
-rw-r--r-- | actionview/test/template/form_collections_helper_test.rb | 7 |
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 32471b1640..41932d15ee 100644 --- a/actionview/test/template/form_collections_helper_test.rb +++ b/actionview/test/template/form_collections_helper_test.rb @@ -270,6 +270,13 @@ class FormCollectionsHelperTest < ActionView::TestCase assert_select "input[type=hidden][name='user[category_ids][]'][value='']", :count => 0 end + test 'collection check boxes does not generate a hidden field if include_hidden option is false with key as string' do + collection = [Category.new(1, 'Category 1'), Category.new(2, 'Category 2')] + with_collection_check_boxes :user, :category_ids, collection, :id, :name, 'include_hidden' => false + + assert_select "input[type=hidden][name='user[category_ids][]'][value='']", count: 0 + end + test 'collection check boxes accepts a collection and generate a series 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 |