aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/template
diff options
context:
space:
mode:
authorLucas Uyezu <lucas.uyezu@gmail.com>2012-08-02 21:23:06 -0300
committerLucas Uyezu <lucas.uyezu@gmail.com>2012-08-13 18:49:47 -0300
commit6446e84c1a0d72ecdba1046c3e15b4467eae9e5b (patch)
tree81293ce71ce3f5038257f5d426a44265c61104c4 /actionpack/test/template
parentfa736e69a197522ae3af3d3e6394cdc1eb1da228 (diff)
downloadrails-6446e84c1a0d72ecdba1046c3e15b4467eae9e5b.tar.gz
rails-6446e84c1a0d72ecdba1046c3e15b4467eae9e5b.tar.bz2
rails-6446e84c1a0d72ecdba1046c3e15b4467eae9e5b.zip
Indentation should consider line number character count.
Diffstat (limited to 'actionpack/test/template')
-rw-r--r--actionpack/test/template/render_test.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/actionpack/test/template/render_test.rb b/actionpack/test/template/render_test.rb
index 164b8b9fa1..b26354e7cc 100644
--- a/actionpack/test/template/render_test.rb
+++ b/actionpack/test/template/render_test.rb
@@ -203,6 +203,15 @@ module RenderTestCases
assert_equal File.expand_path("#{FIXTURE_LOAD_PATH}/test/_raise.html.erb"), e.file_name
end
+ def test_render_error_indentation
+ e = assert_raises(ActionView::Template::Error) { @view.render(:partial => "test/raise_indentation") }
+ error_lines = e.annoted_source_code.split("\n")
+ assert_match %r!error\shere!, e.message
+ assert_equal "11", e.line_number
+ assert_equal " 9: <p>Ninth paragraph</p>", error_lines.second
+ assert_equal " 10: <p>Tenth paragraph</p>", error_lines.third
+ end
+
def test_render_sub_template_with_errors
e = assert_raises(ActionView::Template::Error) { @view.render(:template => "test/sub_template_raise") }
assert_match %r!method.*doesnt_exist!, e.message