From 3334609ecb739c8cb7b488b38452ff76168a20f0 Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Mon, 22 Oct 2007 21:17:20 +0000 Subject: Expand form helper test coverage. Closes #9950 [robinjfisher] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7993 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/test/template/form_tag_helper_test.rb | 56 +++++++++++++++++++++++- 1 file changed, 55 insertions(+), 1 deletion(-) (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 ebf8f7058f..d0f9e9903e 100644 --- a/actionpack/test/template/form_tag_helper_test.rb +++ b/actionpack/test/template/form_tag_helper_test.rb @@ -34,11 +34,17 @@ class FormTagHelperTest < Test::Unit::TestCase assert_dom_equal expected, actual end - def test_form_tag_with_method + def test_form_tag_with_method_put actual = form_tag({}, { :method => :put }) expected = %(
) assert_dom_equal expected, actual end + + def test_form_tag_with_method_delete + actual = form_tag({}, { :method => :delete }) + expected = %(
) + assert_dom_equal expected, actual + end def test_form_tag_with_block _erbout = '' @@ -103,6 +109,18 @@ class FormTagHelperTest < Test::Unit::TestCase expected = %() assert_dom_equal expected, actual end + + def test_select_tag_with_multiple + actual = select_tag "colors", "", :multiple => :true + expected = %() + assert_dom_equal expected, actual + end + + def test_select_tag_disabled + actual = select_tag "places", "", :disabled => :true + expected = %() + assert_dom_equal expected, actual + end def test_text_area_tag_size_string actual = text_area_tag "body", "hello world", "size" => "20x40" @@ -133,6 +151,42 @@ class FormTagHelperTest < Test::Unit::TestCase expected = %() assert_dom_equal expected, actual end + + def test_text_field_tag_size_symbol + actual = text_field_tag "title", "Hello!", :size => 75 + expected = %() + assert_dom_equal expected, actual + end + + def test_text_field_tag_size_string + actual = text_field_tag "title", "Hello!", "size" => "75" + expected = %() + assert_dom_equal expected, actual + end + + def test_text_field_tag_maxlength_symbol + actual = text_field_tag "title", "Hello!", :maxlength => 75 + expected = %() + assert_dom_equal expected, actual + end + + def test_text_field_tag_maxlength_string + actual = text_field_tag "title", "Hello!", "maxlength" => "75" + expected = %() + assert_dom_equal expected, actual + end + + def test_text_field_disabled + actual = text_field_tag "title", "Hello!", :disabled => :true + expected = %() + assert_dom_equal expected, actual + end + + def test_text_field_tag_with_multiple_options + actual = text_field_tag "title", "Hello!", :size => 70, :maxlength => 80 + expected = %() + assert_dom_equal expected, actual + end def test_boolean_optios assert_dom_equal %(), check_box_tag("admin", 1, true, 'disabled' => true, :readonly => "yes") -- cgit v1.2.3