aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/template/form_collections_helper_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/test/template/form_collections_helper_test.rb')
-rw-r--r--actionpack/test/template/form_collections_helper_test.rb8
1 files changed, 5 insertions, 3 deletions
diff --git a/actionpack/test/template/form_collections_helper_test.rb b/actionpack/test/template/form_collections_helper_test.rb
index 995cfdae87..162c609151 100644
--- a/actionpack/test/template/form_collections_helper_test.rb
+++ b/actionpack/test/template/form_collections_helper_test.rb
@@ -249,10 +249,12 @@ class FormCollectionsHelperTest < ActionView::TestCase
end
test 'collection check boxes accepts selected values as :checked option and override the model values' do
- skip "check with fields for"
+ user = Struct.new(:category_ids).new(2)
collection = (1..3).map{|i| [i, "Category #{i}"] }
- :user.category_ids = [2]
- with_collection_check_boxes :user, :category_ids, collection, :first, :last, :checked => [1, 3]
+
+ concat(fields_for(:user, user) do |p|
+ p.collection_check_boxes :category_ids, collection, :first, :last, :checked => [1, 3]
+ end)
assert_select 'input[type=checkbox][value=1][checked=checked]'
assert_select 'input[type=checkbox][value=3][checked=checked]'