From c83f75812ef89aea1b8d138aebec25de8057f156 Mon Sep 17 00:00:00 2001 From: Kevin Glowacz Date: Wed, 30 Apr 2008 17:21:18 -0500 Subject: Fixed labels that have a bracketed name and an index [#68 state:resolved] Signed-off-by: Joshua Peek --- actionpack/test/template/form_helper_test.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'actionpack/test/template') diff --git a/actionpack/test/template/form_helper_test.rb b/actionpack/test/template/form_helper_test.rb index 87e6ca12a1..b4857fcb62 100644 --- a/actionpack/test/template/form_helper_test.rb +++ b/actionpack/test/template/form_helper_test.rb @@ -540,6 +540,18 @@ class FormHelperTest < ActionView::TestCase _erbout end + def test_fields_for_object_with_bracketed_name_and_index + _erbout = '' + fields_for("author[post]", @post, :index => 1) do |f| + _erbout.concat f.label(:title) + _erbout.concat f.text_field(:title) + end + + assert_dom_equal "" + + "", + _erbout + end + def test_form_builder_does_not_have_form_for_method assert ! ActionView::Helpers::FormBuilder.instance_methods.include?('form_for') end -- cgit v1.2.3