Permalink
Browse files

test fails no matter what

  • Loading branch information...
1 parent 692b64e commit ffd4892b8d42e087a827f68b9e56c834bf188a45 @steveklabnik committed Jun 27, 2012
Showing with 11 additions and 0 deletions.
  1. +1 −0 actionpack/lib/action_view/template/handlers/erb.rb
  2. +10 −0 actionpack/test/template/template_test.rb
@@ -79,6 +79,7 @@ def call(template)
self.class.erb_implementation.new(
erb,
+ :escape => template.identifier !~ /\.html/, # only escape HTML templates
:trim => (self.class.erb_trim_mode == "-")
).src
end
@@ -64,6 +64,16 @@ def test_basic_template
assert_equal "Hello", render
end
+ def test_basic_template_does_not_html_escape
+ @template = new_template("&")
+ assert_equal "&", render
+ end
+
+ def test_basic_html_template_does_html_escape
+ @template = ActionView::Template.new("&", ".html", ERBHandler, {})
+ assert_equal "&", render
+ end
+
def test_raw_template
@template = new_template("<%= hello %>", :handler => ActionView::Template::Handlers::Raw.new)
assert_equal "<%= hello %>", render

0 comments on commit ffd4892

Please sign in to comment.