From d0ce7cd4c7eb24c4ade6d8fb4ec73576b8bc1977 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sun, 2 Dec 2007 00:46:43 +0000 Subject: Added the same record identification guessing rules to fields_for as form_for has [DHH] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8252 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/test/template/form_helper_test.rb | 17 +++++++++++++++++ 1 file changed, 17 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 fa53f6ae1a..136e6f1e83 100644 --- a/actionpack/test/template/form_helper_test.rb +++ b/actionpack/test/template/form_helper_test.rb @@ -433,6 +433,23 @@ class FormHelperTest < Test::Unit::TestCase assert_dom_equal expected, _erbout end + def test_fields_for_with_only_object + _erbout = '' + fields_for(@post) do |f| + _erbout.concat f.text_field(:title) + _erbout.concat f.text_area(:body) + _erbout.concat f.check_box(:secret) + end + + expected = + "" + + "" + + "" + + "" + + assert_dom_equal expected, _erbout + end + def test_fields_for_object_with_bracketed_name _erbout = '' fields_for("author[post]", @post) do |f| -- cgit v1.2.3