diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2012-12-03 10:30:58 -0700 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2012-12-03 10:32:23 -0700 |
commit | 9d6e502f81bcf56c7da8a7d1f9e433b4e0a7e3e9 (patch) | |
tree | 3ba56af433cd5294e0b8d2ec392a2054f588a4ff /actionpack/test/controller/new_base | |
parent | 19599c274404169d5c75355a7b5a7f39795b4373 (diff) | |
download | rails-9d6e502f81bcf56c7da8a7d1f9e433b4e0a7e3e9.tar.gz rails-9d6e502f81bcf56c7da8a7d1f9e433b4e0a7e3e9.tar.bz2 rails-9d6e502f81bcf56c7da8a7d1f9e433b4e0a7e3e9.zip |
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.
Conflicts:
actionpack/test/template/template_test.rb
Diffstat (limited to 'actionpack/test/controller/new_base')
-rw-r--r-- | actionpack/test/controller/new_base/render_template_test.rb | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/actionpack/test/controller/new_base/render_template_test.rb b/actionpack/test/controller/new_base/render_template_test.rb index 29c8885d9f..94a928e669 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 '<strong>this is raw</strong>' %>", - "with_implicit_raw.html.erb" => "Hello <%== '<strong>this is also raw</strong>' %>", + "with_implicit_raw.html.erb" => "Hello <%== '<strong>this is also raw</strong>' %> in a html template", + "with_implicit_raw.text.erb" => "Hello <%== '<strong>this is also raw</strong>' %> 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 <strong>this is also raw</strong>" + assert_body "Hello <strong>this is also raw</strong> in a html template" + assert_status 200 + + get :with_implicit_raw, format: 'text' + + assert_body "Hello <strong>this is also raw</strong> in a text template" assert_status 200 end |