aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/template
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2006-09-03 19:32:31 +0000
committerJeremy Kemper <jeremy@bitsweat.net>2006-09-03 19:32:31 +0000
commit4fc6c872ef1f6ae10eec7c24cbc60697336ca707 (patch)
tree4adb364ba265275c82fc797d13c9ac96edd1848c /actionpack/test/template
parentfef2d880a5244516e4891014ffb6bca3d7283272 (diff)
downloadrails-4fc6c872ef1f6ae10eec7c24cbc60697336ca707.tar.gz
rails-4fc6c872ef1f6ae10eec7c24cbc60697336ca707.tar.bz2
rails-4fc6c872ef1f6ae10eec7c24cbc60697336ca707.zip
radio_button_tag generates unique id attributes. Closes #3353.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4925 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test/template')
-rw-r--r--actionpack/test/template/form_tag_helper_test.rb15
1 files changed, 14 insertions, 1 deletions
diff --git a/actionpack/test/template/form_tag_helper_test.rb b/actionpack/test/template/form_tag_helper_test.rb
index 0e4ac5f5a7..743d75ca8c 100644
--- a/actionpack/test/template/form_tag_helper_test.rb
+++ b/actionpack/test/template/form_tag_helper_test.rb
@@ -53,8 +53,21 @@ class FormTagHelperTest < Test::Unit::TestCase
def test_radio_button_tag
actual = radio_button_tag "people", "david"
- expected = %(<input id="people" name="people" type="radio" value="david" />)
+ expected = %(<input id="people_david" name="people" type="radio" value="david" />)
assert_dom_equal expected, actual
+
+ actual = radio_button_tag("num_people", 5)
+ expected = %(<input id="num_people_5" name="num_people" type="radio" value="5" />)
+ assert_dom_equal expected, actual
+
+ actual = radio_button_tag("gender", "m") + radio_button_tag("gender", "f")
+ expected = %(<input id="gender_m" name="gender" type="radio" value="m" /><input id="gender_f" name="gender" type="radio" value="f" />)
+ assert_dom_equal expected, actual
+
+ actual = radio_button_tag("opinion", "-1") + radio_button_tag("opinion", "1")
+ expected = %(<input id="opinion_-1" name="opinion" type="radio" value="-1" /><input id="opinion_1" name="opinion" type="radio" value="1" />)
+ assert_dom_equal expected, actual
+
end
def test_select_tag