aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/template/template_test.rb
diff options
context:
space:
mode:
authorSteve Klabnik <steve@steveklabnik.com>2012-05-13 20:22:29 -0400
committerSteve Klabnik <steve@steveklabnik.com>2012-05-17 12:14:20 -0500
commit8bea607265a2c9bb9bb2188b0a79089ca373b814 (patch)
tree61002877ed6a54499d95b957a23e3a5b183cd577 /actionpack/test/template/template_test.rb
parent1839ecd2288680dba8533610eb4c9dfe2ab6326e (diff)
downloadrails-8bea607265a2c9bb9bb2188b0a79089ca373b814.tar.gz
rails-8bea607265a2c9bb9bb2188b0a79089ca373b814.tar.bz2
rails-8bea607265a2c9bb9bb2188b0a79089ca373b814.zip
Created a Raw handler for templates.
Fixes #2394
Diffstat (limited to 'actionpack/test/template/template_test.rb')
-rw-r--r--actionpack/test/template/template_test.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/actionpack/test/template/template_test.rb b/actionpack/test/template/template_test.rb
index 8c57ada587..322bea3fb0 100644
--- a/actionpack/test/template/template_test.rb
+++ b/actionpack/test/template/template_test.rb
@@ -48,7 +48,7 @@ class TestERBTemplate < ActiveSupport::TestCase
end
def new_template(body = "<%= hello %>", details = {})
- ActionView::Template.new(body, "hello template", ERBHandler, {:virtual_path => "hello"}.merge!(details))
+ ActionView::Template.new(body, "hello template", details.fetch(:handler) { ERBHandler }, {:virtual_path => "hello"}.merge!(details))
end
def render(locals = {})
@@ -64,6 +64,11 @@ class TestERBTemplate < ActiveSupport::TestCase
assert_equal "Hello", render
end
+ def test_raw_template
+ @template = new_template("<%= hello %>", :handler => ActionView::Template::Handlers::Raw.new)
+ assert_equal "<%= hello %>", render
+ end
+
def test_template_loses_its_source_after_rendering
@template = new_template
render