aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/template/tag_helper_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/test/template/tag_helper_test.rb')
-rw-r--r--actionpack/test/template/tag_helper_test.rb18
1 files changed, 9 insertions, 9 deletions
diff --git a/actionpack/test/template/tag_helper_test.rb b/actionpack/test/template/tag_helper_test.rb
index 433f6514cf..256d9bdcde 100644
--- a/actionpack/test/template/tag_helper_test.rb
+++ b/actionpack/test/template/tag_helper_test.rb
@@ -37,18 +37,18 @@ class TagHelperTest < ActionView::TestCase
assert content_tag("a", "Create", "href" => "create").html_safe?
assert_equal content_tag("a", "Create", "href" => "create"),
content_tag("a", "Create", :href => "create")
+ assert_equal "<p>&lt;script&gt;evil_js&lt;/script&gt;</p>",
+ content_tag(:p, '<script>evil_js</script>')
end
def test_content_tag_with_block_in_erb
- __in_erb_template = ''
- content_tag(:div) { concat "Hello world!" }
- assert_dom_equal "<div>Hello world!</div>", output_buffer
+ buffer = content_tag(:div) { concat "Hello world!" }
+ assert_dom_equal "<div>Hello world!</div>", buffer
end
def test_content_tag_with_block_and_options_in_erb
- __in_erb_template = ''
- content_tag(:div, :class => "green") { concat "Hello world!" }
- assert_dom_equal %(<div class="green">Hello world!</div>), output_buffer
+ buffer = content_tag(:div, :class => "green") { concat "Hello world!" }
+ assert_dom_equal %(<div class="green">Hello world!</div>), buffer
end
def test_content_tag_with_block_and_options_out_of_erb
@@ -66,10 +66,10 @@ class TagHelperTest < ActionView::TestCase
output_buffer
end
+ # TAG TODO: Move this into a real template
def test_content_tag_nested_in_content_tag_in_erb
- __in_erb_template = true
- content_tag("p") { concat content_tag("b", "Hello") }
- assert_equal '<p><b>Hello</b></p>', output_buffer
+ buffer = content_tag("p") { concat content_tag("b", "Hello") }
+ assert_equal '<p><b>Hello</b></p>', buffer
end
def test_content_tag_with_escaped_array_class