Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

test fails no matter what

  • Loading branch information...
commit ffd4892b8d42e087a827f68b9e56c834bf188a45 1 parent 692b64e
@steveklabnik authored
View
1  actionpack/lib/action_view/template/handlers/erb.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
View
10 actionpack/test/template/template_test.rb
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.