diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2008-08-22 13:01:53 -0700 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2008-08-22 13:01:53 -0700 |
commit | 9dac5547ad65e82a6fbb6a6243ab5c95d9c44db0 (patch) | |
tree | 24dcf69c35ba59e499d4e6e07b4618719599aaf8 /actionpack/test | |
parent | a6e05b18d65d07a157ee09d54167c81f3d1440f8 (diff) | |
parent | c0dd0cee46ac2d0864dc8bbdac1fe526f9cec346 (diff) | |
download | rails-9dac5547ad65e82a6fbb6a6243ab5c95d9c44db0.tar.gz rails-9dac5547ad65e82a6fbb6a6243ab5c95d9c44db0.tar.bz2 rails-9dac5547ad65e82a6fbb6a6243ab5c95d9c44db0.zip |
Merge branch 'master' into i18n
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/activerecord/render_partial_with_record_identification_test.rb | 10 | ||||
-rw-r--r-- | actionpack/test/template/render_test.rb | 4 |
2 files changed, 14 insertions, 0 deletions
diff --git a/actionpack/test/activerecord/render_partial_with_record_identification_test.rb b/actionpack/test/activerecord/render_partial_with_record_identification_test.rb index a82a1a3023..d75cb2b53a 100644 --- a/actionpack/test/activerecord/render_partial_with_record_identification_test.rb +++ b/actionpack/test/activerecord/render_partial_with_record_identification_test.rb @@ -39,6 +39,11 @@ class RenderPartialWithRecordIdentificationController < ActionController::Base @developers = Developer.find(:all) render :partial => @developers end + + def render_with_record_collection_and_spacer_template + @developer = Developer.find(1) + render :partial => @developer.projects, :spacer_template => 'test/partial_only' + end end class RenderPartialWithRecordIdentificationTest < ActiveRecordTestCase @@ -81,6 +86,11 @@ class RenderPartialWithRecordIdentificationTest < ActiveRecordTestCase assert_equal 'DavidJamisfixture_3fixture_4fixture_5fixture_6fixture_7fixture_8fixture_9fixture_10Jamis', @response.body end + def test_render_with_record_collection_and_spacer_template + get :render_with_record_collection_and_spacer_template + assert_equal 'Active Recordonly partialActive Controller', @response.body + end + def test_rendering_partial_with_has_one_association mascot = Company.find(1).mascot get :render_with_has_one_association diff --git a/actionpack/test/template/render_test.rb b/actionpack/test/template/render_test.rb index 25bbc263dd..f3c8dbcae9 100644 --- a/actionpack/test/template/render_test.rb +++ b/actionpack/test/template/render_test.rb @@ -95,6 +95,10 @@ class ViewRenderTest < Test::Unit::TestCase assert_nil @view.render(:partial => "test/customer", :collection => nil) end + def test_render_partial_with_empty_array_should_return_nil + assert_nil @view.render(:partial => []) + end + # TODO: The reason for this test is unclear, improve documentation def test_render_partial_and_fallback_to_layout assert_equal "Before (Josh)\n\nAfter", @view.render(:partial => "test/layout_for_partial", :locals => { :name => "Josh" }) |