From a7764d8fd491fb49f50397aa79d305bdb93552c5 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sat, 22 Sep 2007 17:17:22 +0000 Subject: Added FormHelper#label (closes #8641) [jcoglan] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7541 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/test/template/form_helper_test.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'actionpack/test') diff --git a/actionpack/test/template/form_helper_test.rb b/actionpack/test/template/form_helper_test.rb index a852f2af17..af63a056f8 100644 --- a/actionpack/test/template/form_helper_test.rb +++ b/actionpack/test/template/form_helper_test.rb @@ -70,6 +70,19 @@ class FormHelperTest < Test::Unit::TestCase @controller = @controller.new end + def test_label + assert_dom_equal('', label("post", "title")) + assert_dom_equal('', label("post", "title", "The title goes here")) + assert_dom_equal( + '', + label("post", "title", nil, :class => 'title_label') + ) + end + + def test_label_with_symbols + assert_dom_equal('', label(:post, :title)) + end + def test_text_field assert_dom_equal( '', text_field("post", "title") @@ -275,6 +288,7 @@ class FormHelperTest < Test::Unit::TestCase _erbout = '' form_for(:post, @post, :html => { :id => 'create-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) @@ -283,6 +297,7 @@ class FormHelperTest < Test::Unit::TestCase expected = "
" + + "" + "" + "" + "" + -- cgit v1.2.3