From 2797757919e95177c42d70c178e16c88828b674a Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Mon, 3 Dec 2012 10:30:58 -0700 Subject: Override <%== to always behave as literal text rather than toggling based on whether escaping is enabled. Fixes that existing plaintext email templates using <%== unexpectedly flipped to *escaping* HTML when #8235 was merged. --- actionpack/test/controller/new_base/render_template_test.rb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'actionpack/test/controller') diff --git a/actionpack/test/controller/new_base/render_template_test.rb b/actionpack/test/controller/new_base/render_template_test.rb index d0be4f66d1..6b2ae2b2a9 100644 --- a/actionpack/test/controller/new_base/render_template_test.rb +++ b/actionpack/test/controller/new_base/render_template_test.rb @@ -9,7 +9,8 @@ module RenderTemplate "locals.html.erb" => "The secret is <%= secret %>", "xml_template.xml.builder" => "xml.html do\n xml.p 'Hello'\nend", "with_raw.html.erb" => "Hello <%=raw 'this is raw' %>", - "with_implicit_raw.html.erb" => "Hello <%== 'this is also raw' %>", + "with_implicit_raw.html.erb" => "Hello <%== 'this is also raw' %> in a html template", + "with_implicit_raw.text.erb" => "Hello <%== 'this is also raw' %> in a text template", "test/with_json.html.erb" => "<%= render :template => 'test/with_json', :formats => [:json] %>", "test/with_json.json.erb" => "<%= render :template => 'test/final', :formats => [:json] %>", "test/final.json.erb" => "{ final: json }", @@ -113,7 +114,12 @@ module RenderTemplate get :with_implicit_raw - assert_body "Hello this is also raw" + assert_body "Hello this is also raw in a html template" + assert_status 200 + + get :with_implicit_raw, format: 'text' + + assert_body "Hello this is also raw in a text template" assert_status 200 end -- cgit v1.2.3