aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorStephen Anderson <stephen@bendycode.com>2009-01-06 11:28:40 -0600
committerMichael Koziarski <michael@koziarski.com>2009-06-09 20:36:45 +1200
commita94e7d7897a300a95d5d5a00c5efc573b42bcb58 (patch)
treed28986ca8f36c041f6f3e685f798b9ce566e2529 /actionpack/test
parenta14df8c9b26b489f1db8fba64c72da3f20af7fcd (diff)
downloadrails-a94e7d7897a300a95d5d5a00c5efc573b42bcb58.tar.gz
rails-a94e7d7897a300a95d5d5a00c5efc573b42bcb58.tar.bz2
rails-a94e7d7897a300a95d5d5a00c5efc573b42bcb58.zip
Sanitized the id generated by text_area_tag helper method. text_area_tag('item[description]') should return: <textarea id="item_description" name="item[description]"></textarea> instead of: <textarea id="item[description]" name="item[description]"></textarea> The old id was causing HTML validation failures.
Signed-off-by: Michael Koziarski <michael@koziarski.com>
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/template/form_tag_helper_test.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/actionpack/test/template/form_tag_helper_test.rb b/actionpack/test/template/form_tag_helper_test.rb
index 5ca4d4d6ea..09d199b75d 100644
--- a/actionpack/test/template/form_tag_helper_test.rb
+++ b/actionpack/test/template/form_tag_helper_test.rb
@@ -154,6 +154,11 @@ class FormTagHelperTest < ActionView::TestCase
assert_dom_equal expected, actual
end
+ def test_text_area_tag_id_sanitized
+ input_elem = root_elem(text_area_tag("item[][description]"))
+ assert_match VALID_HTML_ID, input_elem['id']
+ end
+
def test_text_field_tag
actual = text_field_tag "title", "Hello!"
expected = %(<input id="title" name="title" type="text" value="Hello!" />)