aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorChris Mear <chris@feedmechocolate.com>2009-02-19 14:16:10 +0000
committerMichael Koziarski <michael@koziarski.com>2009-06-27 13:16:52 +1200
commit085db5e128ad4ad8fd042776722c78e194c6d0a4 (patch)
treef2d54c38a4a4a08cd2b4d5fa74717ad7c07a25cc /actionpack/test
parent68b02cb00aae4f4ee1b2b9b1eadb6951b747c181 (diff)
downloadrails-085db5e128ad4ad8fd042776722c78e194c6d0a4.tar.gz
rails-085db5e128ad4ad8fd042776722c78e194c6d0a4.tar.bz2
rails-085db5e128ad4ad8fd042776722c78e194c6d0a4.zip
Make text_area_tag escape contents by default.
Signed-off-by: Michael Koziarski <michael@koziarski.com> [#2015 state:committed]
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/template/form_tag_helper_test.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/actionpack/test/template/form_tag_helper_test.rb b/actionpack/test/template/form_tag_helper_test.rb
index 09d199b75d..f387123117 100644
--- a/actionpack/test/template/form_tag_helper_test.rb
+++ b/actionpack/test/template/form_tag_helper_test.rb
@@ -159,6 +159,18 @@ class FormTagHelperTest < ActionView::TestCase
assert_match VALID_HTML_ID, input_elem['id']
end
+ def test_text_area_tag_escape_content
+ actual = text_area_tag "body", "<b>hello world</b>", :size => "20x40"
+ expected = %(<textarea cols="20" id="body" name="body" rows="40">&lt;b&gt;hello world&lt;/b&gt;</textarea>)
+ assert_dom_equal expected, actual
+ end
+
+ def test_text_area_tag_unescaped_content
+ actual = text_area_tag "body", "<b>hello world</b>", :size => "20x40", :escape => false
+ expected = %(<textarea cols="20" id="body" name="body" rows="40"><b>hello world</b></textarea>)
+ assert_dom_equal expected, actual
+ end
+
def test_text_field_tag
actual = text_field_tag "title", "Hello!"
expected = %(<input id="title" name="title" type="text" value="Hello!" />)