From 4e9abdd7f1b4e05f8d1b50ddaa080b3ff63b92d9 Mon Sep 17 00:00:00 2001 From: "Hongli Lai (Phusion)" Date: Thu, 13 Nov 2008 21:49:23 +0100 Subject: Tag helper should output an attribute with the value 'false' instead of omitting the attribute, if the associated option is false but not nil. --- actionpack/test/template/form_tag_helper_test.rb | 2 +- actionpack/test/template/tag_helper_test.rb | 4 ++++ 2 files changed, 5 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 de82647813..f8add0bab1 100644 --- a/actionpack/test/template/form_tag_helper_test.rb +++ b/actionpack/test/template/form_tag_helper_test.rb @@ -235,7 +235,7 @@ class FormTagHelperTest < ActionView::TestCase assert_match VALID_HTML_ID, label_elem['for'] end - def test_boolean_optios + def test_boolean_options 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) assert_dom_equal %(), select_tag("people", "", :multiple => true) diff --git a/actionpack/test/template/tag_helper_test.rb b/actionpack/test/template/tag_helper_test.rb index fc49d340ef..ef88cae5b8 100644 --- a/actionpack/test/template/tag_helper_test.rb +++ b/actionpack/test/template/tag_helper_test.rb @@ -19,6 +19,10 @@ class TagHelperTest < ActionView::TestCase assert_equal "

", tag("p", :ignored => nil) end + def test_tag_options_accepts_false_option + assert_equal "

", tag("p", :value => false) + end + def test_tag_options_accepts_blank_option assert_equal "

", tag("p", :included => '') end -- cgit v1.2.3