summaryrefslogtreecommitdiff
path: root/test/cgi
diff options
context:
space:
mode:
authorxibbar <xibbar@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-09-17 04:49:28 +0000
committerxibbar <xibbar@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-09-17 04:49:28 +0000
commit4ac4e2fbc451df15b49f81e639dfb97c18e8e89a (patch)
treef0bb0eb1cd75e7013c9327f4a8622d7ad98f6d06 /test/cgi
parentb27d5a7aa1438c8fe381434e21d4b838e914e450 (diff)
* lib/cgi/html.rb (checkbox_group,radio_group): bug fix
use size instead of bytesize. * test/cgi/test_cgi_tag_helper.rb: test for checkbox_group,radio_group. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19395 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/cgi')
-rwxr-xr-xtest/cgi/test_cgi_tag_helper.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/cgi/test_cgi_tag_helper.rb b/test/cgi/test_cgi_tag_helper.rb
index 3ff2f54d420..38533a11e80 100755
--- a/test/cgi/test_cgi_tag_helper.rb
+++ b/test/cgi/test_cgi_tag_helper.rb
@@ -305,6 +305,14 @@ class CGITagHelperTest < Test::Unit::TestCase
assert_equal('<TH>foo</TH>',cgi.th{'foo'})
assert_equal('<TD>',cgi.td)
assert_equal('<TD>foo</TD>',cgi.td{'foo'})
+ str=cgi.checkbox_group("foo",["aa","bb"],["cc","dd"])
+ assert_match(/^<INPUT .*VALUE="aa".*>bb<INPUT .*VALUE="cc".*>dd$/,str)
+ assert_match(/^<INPUT .*TYPE="checkbox".*>bb<INPUT .*TYPE="checkbox".*>dd$/,str)
+ assert_match(/^<INPUT .*NAME="foo".*>bb<INPUT .*NAME="foo".*>dd$/,str)
+ str=cgi.radio_group("foo",["aa","bb"],["cc","dd"])
+ assert_match(/^<INPUT .*VALUE="aa".*>bb<INPUT .*VALUE="cc".*>dd$/,str)
+ assert_match(/^<INPUT .*TYPE="radio".*>bb<INPUT .*TYPE="radio".*>dd$/,str)
+ assert_match(/^<INPUT .*NAME="foo".*>bb<INPUT .*NAME="foo".*>dd$/,str)
end
=begin