diff options
author | Pratik Naik <pratiknaik@gmail.com> | 2008-09-27 14:04:46 +0100 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2008-09-27 14:04:46 +0100 |
commit | fda846cf5ddf523b00a39c26591489794b5de568 (patch) | |
tree | 00d4860d53e5c861fd9b3f483f04ff0d2db19307 /actionpack/test/template/render_test.rb | |
parent | df046298715b1927a832973c4c29955696fee02c (diff) | |
parent | ea609b265ffc30cac00bf09a262027f96964ed6f (diff) | |
download | rails-fda846cf5ddf523b00a39c26591489794b5de568.tar.gz rails-fda846cf5ddf523b00a39c26591489794b5de568.tar.bz2 rails-fda846cf5ddf523b00a39c26591489794b5de568.zip |
Merge commit 'mainstream/master'
Conflicts:
activerecord/lib/active_record/base.rb
railties/Rakefile
railties/doc/guides/activerecord/association_basics.txt
railties/doc/guides/debugging/debugging_rails_applications.txt
railties/doc/guides/getting_started_with_rails/getting_started_with_rails.txt
railties/doc/guides/index.txt
railties/doc/guides/migrations/foreign_keys.txt
railties/doc/guides/migrations/migrations.txt
railties/doc/guides/migrations/writing_a_migration.txt
railties/doc/guides/routing/routing_outside_in.txt
Diffstat (limited to 'actionpack/test/template/render_test.rb')
-rw-r--r-- | actionpack/test/template/render_test.rb | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/actionpack/test/template/render_test.rb b/actionpack/test/template/render_test.rb index f3c8dbcae9..a4ea22ddcb 100644 --- a/actionpack/test/template/render_test.rb +++ b/actionpack/test/template/render_test.rb @@ -70,7 +70,23 @@ class ViewRenderTest < Test::Unit::TestCase end def test_render_partial_with_errors - assert_raise(ActionView::TemplateError) { @view.render(:partial => "test/raise") } + @view.render(:partial => "test/raise") + flunk "Render did not raise TemplateError" + rescue ActionView::TemplateError => e + assert_match "undefined local variable or method `doesnt_exist'", e.message + assert_equal "", e.sub_template_message + assert_equal "1", e.line_number + assert_equal File.expand_path("#{FIXTURE_LOAD_PATH}/test/_raise.html.erb"), e.file_name + end + + def test_render_sub_template_with_errors + @view.render(:file => "test/sub_template_raise") + flunk "Render did not raise TemplateError" + rescue ActionView::TemplateError => e + assert_match "undefined local variable or method `doesnt_exist'", e.message + assert_equal "Trace of template inclusion: #{File.expand_path("#{FIXTURE_LOAD_PATH}/test/sub_template_raise.html.erb")}", e.sub_template_message + assert_equal "1", e.line_number + assert_equal File.expand_path("#{FIXTURE_LOAD_PATH}/test/_raise.html.erb"), e.file_name end def test_render_partial_collection |