aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller/render_test.rb
diff options
context:
space:
mode:
authorMichael Koziarski <michael@koziarski.com>2008-01-27 20:48:13 +0000
committerMichael Koziarski <michael@koziarski.com>2008-01-27 20:48:13 +0000
commitaecb7fbefcb1471080c3ad33a4a2e8601fabb503 (patch)
tree599a594a04797b404aabfaa5ff37dc25dda2fca1 /actionpack/test/controller/render_test.rb
parentc155fe9a3910fe3ab2e9cabe0ceb1c44fab31d72 (diff)
downloadrails-aecb7fbefcb1471080c3ad33a4a2e8601fabb503.tar.gz
rails-aecb7fbefcb1471080c3ad33a4a2e8601fabb503.tar.bz2
rails-aecb7fbefcb1471080c3ad33a4a2e8601fabb503.zip
Correct line numbers from template errors. Closes #10937 [Aleksey Kondratenko]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8744 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test/controller/render_test.rb')
-rw-r--r--actionpack/test/controller/render_test.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/actionpack/test/controller/render_test.rb b/actionpack/test/controller/render_test.rb
index c258ae216b..4768dffba2 100644
--- a/actionpack/test/controller/render_test.rb
+++ b/actionpack/test/controller/render_test.rb
@@ -86,6 +86,15 @@ class TestController < ActionController::Base
render :xml => "<blah/>", :content_type => "application/atomsvc+xml"
end
+ def render_line_offset
+ begin
+ render :inline => '<% raise %>', :locals => {:foo => 'bar'}
+ rescue => exc
+ end
+ line = exc.backtrace.first
+ render :text => line
+ end
+
def heading
head :ok
end
@@ -225,6 +234,13 @@ class RenderTest < Test::Unit::TestCase
assert_template "test/hello_world"
end
+ def test_line_offset
+ get :render_line_offset
+ line = @response.body
+ assert(line =~ %r{:(\d+):})
+ assert_equal "1", $1
+ end
+
def test_render_with_forward_slash
get :render_hello_world_with_forward_slash
assert_template "test/hello_world"