aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/template
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2004-12-14 13:48:27 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2004-12-14 13:48:27 +0000
commitc80f974fa3071104397d8dd5752ff60bca1881fe (patch)
tree4d679c841f3ceddbeb15eb0610a1f2afec32d8c5 /actionpack/test/template
parente5a8d8ebbbb21dcd05d98d055dd0f75da972543e (diff)
downloadrails-c80f974fa3071104397d8dd5752ff60bca1881fe.tar.gz
rails-c80f974fa3071104397d8dd5752ff60bca1881fe.tar.bz2
rails-c80f974fa3071104397d8dd5752ff60bca1881fe.zip
Added FormHelper#radio_button to work with radio buttons like its already possible with check boxes [Michael Koziarski]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@151 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test/template')
-rw-r--r--actionpack/test/template/form_helper_test.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/actionpack/test/template/form_helper_test.rb b/actionpack/test/template/form_helper_test.rb
index 8f3d5ebb94..d81e2ac270 100644
--- a/actionpack/test/template/form_helper_test.rb
+++ b/actionpack/test/template/form_helper_test.rb
@@ -1,4 +1,5 @@
require 'test/unit'
+require 'erb'
require File.dirname(__FILE__) + '/../../lib/action_view/helpers/form_helper'
class FormHelperTest < Test::Unit::TestCase
@@ -70,6 +71,15 @@ class FormHelperTest < Test::Unit::TestCase
check_box("post", "secret")
)
end
+
+ def test_radio_button
+ assert_equal('<input checked="checked" id="post_title" name="post[title]" size="30" type="radio" value="Hello World" />',
+ radio_button("post", "title", "Hello World")
+ )
+ assert_equal('<input id="post_title" name="post[title]" size="30" type="radio" value="Goodbye World" />',
+ radio_button("post", "title", "Goodbye World")
+ )
+ end
def test_text_area
assert_equal(