From 7701e6466dd5f6ca1b3eb1bfaf73f1d0723bb324 Mon Sep 17 00:00:00 2001 From: Michael Koziarski Date: Mon, 21 Jan 2008 21:08:28 +0000 Subject: Add label_tag helper for generating elements. Closes #10802 [DefV] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8685 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/test/template/form_tag_helper_test.rb | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'actionpack/test') diff --git a/actionpack/test/template/form_tag_helper_test.rb b/actionpack/test/template/form_tag_helper_test.rb index 3ca3e743eb..4160c838cc 100644 --- a/actionpack/test/template/form_tag_helper_test.rb +++ b/actionpack/test/template/form_tag_helper_test.rb @@ -188,6 +188,24 @@ class FormTagHelperTest < Test::Unit::TestCase assert_dom_equal expected, actual end + def test_label_tag_without_text + actual = label_tag "title" + expected = %() + assert_dom_equal expected, actual + end + + def test_label_tag_with_text + actual = label_tag "title", "My Title" + expected = %() + assert_dom_equal expected, actual + end + + def test_label_tag_class_string + actual = label_tag "title", "My Title", "class" => "small_label" + expected = %() + assert_dom_equal expected, actual + end + def test_boolean_optios assert_dom_equal %(), check_box_tag("admin", 1, true, 'disabled' => true, :readonly => "yes") assert_dom_equal %(), check_box_tag("admin", 1, true, :disabled => false, :readonly => nil) -- cgit v1.2.3