From a55caf666cf4c00bdc5d73ac21ef92d6456cdf62 Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Sat, 27 Oct 2007 20:30:05 +0000 Subject: Tested FormHelper#label. Closes #9850 [jarkko] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8045 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/CHANGELOG | 2 +- actionpack/test/template/form_helper_test.rb | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) (limited to 'actionpack') diff --git a/actionpack/CHANGELOG b/actionpack/CHANGELOG index 51b4135886..a7fa597c89 100644 --- a/actionpack/CHANGELOG +++ b/actionpack/CHANGELOG @@ -103,7 +103,7 @@ * Fixed that setting the :host option in url_for would automatically turn off :only_path (since :host would otherwise not be shown) #9586 [Bounga] -* Added FormHelper#label #8641 [jcoglan] +* Added FormHelper#label. #8641, #9850 [jcoglan, jarkko] * Added AtomFeedHelper (slightly improved from the atom_feed_helper plugin) [DHH] diff --git a/actionpack/test/template/form_helper_test.rb b/actionpack/test/template/form_helper_test.rb index f37469954a..fa53f6ae1a 100644 --- a/actionpack/test/template/form_helper_test.rb +++ b/actionpack/test/template/form_helper_test.rb @@ -272,6 +272,10 @@ class FormHelperTest < Test::Unit::TestCase def test_auto_index pid = @post.id + assert_dom_equal( + "", + label("post[]", "title") + ) assert_dom_equal( "", text_field("post[]","title") ) @@ -361,6 +365,7 @@ class FormHelperTest < Test::Unit::TestCase _erbout = '' form_for("post[]", @post) do |f| + _erbout.concat f.label(:title) _erbout.concat f.text_field(:title) _erbout.concat f.text_area(:body) _erbout.concat f.check_box(:secret) @@ -368,6 +373,7 @@ class FormHelperTest < Test::Unit::TestCase expected = "
" + + "" + "" + "" + "" + @@ -430,10 +436,12 @@ class FormHelperTest < Test::Unit::TestCase def test_fields_for_object_with_bracketed_name _erbout = '' fields_for("author[post]", @post) do |f| + _erbout.concat f.label(:title) _erbout.concat f.text_field(:title) end - assert_dom_equal "", + assert_dom_equal "" + + "", _erbout end -- cgit v1.2.3