From c7760809bfc8e19362272b71b23a294d48195d65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Thu, 7 Oct 2010 21:30:19 +0200 Subject: Allow cache to be temporarily disabled through lookup_context. --- actionpack/test/controller/new_base/render_template_test.rb | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'actionpack/test/controller/new_base') diff --git a/actionpack/test/controller/new_base/render_template_test.rb b/actionpack/test/controller/new_base/render_template_test.rb index 8f5f51d70b..d31193a063 100644 --- a/actionpack/test/controller/new_base/render_template_test.rb +++ b/actionpack/test/controller/new_base/render_template_test.rb @@ -11,7 +11,8 @@ module RenderTemplate "with_raw.html.erb" => "Hello <%=raw 'this is raw' %>", "test/with_json.html.erb" => "<%= render :template => 'test/with_json.json' %>", "test/with_json.json.erb" => "<%= render :template => 'test/final' %>", - "test/final.json.erb" => "{ final: json }" + "test/final.json.erb" => "{ final: json }", + "test/with_error.html.erb" => "<%= idontexist %>" )] def index @@ -49,6 +50,10 @@ module RenderTemplate def with_raw render :template => "with_raw" end + + def with_error + render :template => "test/with_error" + end end class TestWithoutLayout < Rack::TestCase @@ -101,6 +106,12 @@ module RenderTemplate assert_content_type "text/html; charset=utf-8" assert_response "{ final: json }" end + + test "rendering a template with error properly exceprts the code" do + get :with_error + assert_status 500 + assert_match "undefined local variable or method `idontexist'", response.body + end end class WithLayoutController < ::ApplicationController -- cgit v1.2.3