diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-03-20 14:49:37 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-03-20 14:49:37 +0000 |
commit | ebf66379186db094ba94914c2aed4e6a485d4708 (patch) | |
tree | f468389b64f309a60fe40cdf43137e47889142c0 /actionpack/test/template | |
parent | f22b000546301b0f87c5074b21552b77b7b2f98a (diff) | |
download | rails-ebf66379186db094ba94914c2aed4e6a485d4708.tar.gz rails-ebf66379186db094ba94914c2aed4e6a485d4708.tar.bz2 rails-ebf66379186db094ba94914c2aed4e6a485d4708.zip |
Added that the html options disabled, readonly, and multiple can all be treated as booleans. So specifying <tt>disabled => :true</tt> will give <tt>disabled="disabled"</tt>. #809 [mindel]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@932 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test/template')
-rw-r--r-- | actionpack/test/template/form_tag_helper_test.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/actionpack/test/template/form_tag_helper_test.rb b/actionpack/test/template/form_tag_helper_test.rb index ab597d61a0..7a666271c1 100644 --- a/actionpack/test/template/form_tag_helper_test.rb +++ b/actionpack/test/template/form_tag_helper_test.rb @@ -81,5 +81,11 @@ class FormTagHelperTest < Test::Unit::TestCase assert_equal expected, actual end + def test_boolean_optios + assert_equal %(<input checked="checked" disabled="disabled" id="admin" name="admin" readonly="readonly" type="checkbox" value="1" />), check_box_tag("admin", 1, true, 'disabled' => true, :readonly => "yes") + assert_equal %(<input checked="checked" id="admin" name="admin" type="checkbox" value="1" />), check_box_tag("admin", 1, true, :disabled => false, :readonly => nil) + assert_equal %(<select id="people" multiple="multiple" name="people"><option>david</option></select>), select_tag("people", "<option>david</option>", :multiple => true) + assert_equal %(<select id="people" name="people"><option>david</option></select>), select_tag("people", "<option>david</option>", :multiple => nil) + end end |