diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2008-05-01 17:56:32 -0500 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2008-05-01 17:56:32 -0500 |
commit | f6ec296ad84ac7e321980cfdd8bba2ea6ce3a14b (patch) | |
tree | b6478394f9ac4e475892130cf3e128dfd48b82bb /actionpack/test/template/form_helper_test.rb | |
parent | 12288a034120e8b1f90fcd4ae5881a858fd1425e (diff) | |
download | rails-f6ec296ad84ac7e321980cfdd8bba2ea6ce3a14b.tar.gz rails-f6ec296ad84ac7e321980cfdd8bba2ea6ce3a14b.tar.bz2 rails-f6ec296ad84ac7e321980cfdd8bba2ea6ce3a14b.zip |
Fixed that TextHelper#text_field would corrypt when raw HTML was used as the value (mchenryc, Kevin Glowacz) [#80 state:resolved]
Diffstat (limited to 'actionpack/test/template/form_helper_test.rb')
-rw-r--r-- | actionpack/test/template/form_helper_test.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/actionpack/test/template/form_helper_test.rb b/actionpack/test/template/form_helper_test.rb index b4857fcb62..204575fd89 100644 --- a/actionpack/test/template/form_helper_test.rb +++ b/actionpack/test/template/form_helper_test.rb @@ -104,6 +104,14 @@ class FormHelperTest < ActionView::TestCase ) end + def test_text_field_with_html_entities + @post.title = "The HTML Entity for & is &" + assert_dom_equal( + '<input id="post_title" name="post[title]" size="30" type="text" value="The HTML Entity for & is &amp;" />', + text_field("post", "title") + ) + end + def test_text_field_with_options expected = '<input id="post_title" name="post[title]" size="35" type="text" value="Hello World" />' assert_dom_equal expected, text_field("post", "title", "size" => 35) @@ -227,6 +235,14 @@ class FormHelperTest < ActionView::TestCase ) end + def test_text_area_with_html_entities + @post.body = "The HTML Entity for & is &" + assert_dom_equal( + '<textarea cols="40" id="post_body" name="post[body]" rows="20">The HTML Entity for & is &amp;</textarea>', + text_area("post", "body") + ) + end + def test_text_area_with_size_option assert_dom_equal( '<textarea cols="183" id="post_body" name="post[body]" rows="820">Back to the hill and over it again!</textarea>', |