diff options
author | Tieg Zaharia <tieg@kickstarter.com> | 2012-04-16 13:53:51 -0400 |
---|---|---|
committer | Tieg Zaharia <tieg@kickstarter.com> | 2012-04-16 13:56:32 -0400 |
commit | dfab28b2ca28b477f83befbba639adb6d15c8ce0 (patch) | |
tree | 7f5b05a27f132b600326c19403c87b48aa9cc881 /actionpack/test | |
parent | a0c2cfdc51e16fc39c1d3b1e78bdd257188fa04e (diff) | |
download | rails-dfab28b2ca28b477f83befbba639adb6d15c8ce0.tar.gz rails-dfab28b2ca28b477f83befbba639adb6d15c8ce0.tar.bz2 rails-dfab28b2ca28b477f83befbba639adb6d15c8ce0.zip |
catch nil.to_sym errors in partial_renderer, and raise ArgumentError instead
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/template/render_test.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/actionpack/test/template/render_test.rb b/actionpack/test/template/render_test.rb index 122b07d348..11f0e7472a 100644 --- a/actionpack/test/template/render_test.rb +++ b/actionpack/test/template/render_test.rb @@ -161,6 +161,15 @@ module RenderTestCases "and is followed by any combinations of letters, numbers, or underscores.", e.message end + def test_render_partial_with_missing_filename + @view.render(:partial => "test/") + flunk "Render did not raise ArgumentError" + rescue ArgumentError => e + assert_equal "The partial name (test/) is not a valid Ruby identifier; " + + "make sure your partial name starts with a letter or underscore, " + + "and is followed by any combinations of letters, numbers, or underscores.", e.message + end + def test_render_partial_with_incompatible_object @view.render(:partial => nil) flunk "Render did not raise ArgumentError" |