diff options
author | Marcel Molina <marcel@vernix.org> | 2008-02-08 22:04:06 +0000 |
---|---|---|
committer | Marcel Molina <marcel@vernix.org> | 2008-02-08 22:04:06 +0000 |
commit | c848c4c6217d825514fe96b37c17ac446a9cd779 (patch) | |
tree | ac03c2b65af69d0d13cda5997960ecc5b0c1646b /actionpack/test | |
parent | 218417b8a93f3c13c9328669db2a1baa60c53562 (diff) | |
download | rails-c848c4c6217d825514fe96b37c17ac446a9cd779.tar.gz rails-c848c4c6217d825514fe96b37c17ac446a9cd779.tar.bz2 rails-c848c4c6217d825514fe96b37c17ac446a9cd779.zip |
Fix problem with render :partial collections, records, and locals. #11057 [lotswholetime]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8822 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/activerecord/render_partial_with_record_identification_test.rb | 3 | ||||
-rw-r--r-- | actionpack/test/controller/new_render_test.rb | 9 |
2 files changed, 12 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 1cfd2a2354..773018d445 100644 --- a/actionpack/test/activerecord/render_partial_with_record_identification_test.rb +++ b/actionpack/test/activerecord/render_partial_with_record_identification_test.rb @@ -34,6 +34,7 @@ class RenderPartialWithRecordIdentificationTest < ActiveRecordTestCase render :partial => @developers end end + RenderPartialWithRecordIdentificationController.view_paths = [ File.dirname(__FILE__) + "/../fixtures/" ] def setup @controller = RenderPartialWithRecordIdentificationController.new @@ -58,8 +59,10 @@ class RenderPartialWithRecordIdentificationTest < ActiveRecordTestCase end def test_rendering_partial_with_belongs_to_association + topic = Reply.find(1).topic get :render_with_belongs_to_association assert_template 'topics/_topic' + assert_equal topic.title, @response.body end def test_render_with_record diff --git a/actionpack/test/controller/new_render_test.rb b/actionpack/test/controller/new_render_test.rb index d3f5ccf4aa..4d62647e8b 100644 --- a/actionpack/test/controller/new_render_test.rb +++ b/actionpack/test/controller/new_render_test.rb @@ -151,6 +151,10 @@ class NewRenderTestController < ActionController::Base render :partial => "customer_greeting", :collection => [ Customer.new("david"), Customer.new("mary") ], :locals => { :greeting => "Bonjour" } end + def partial_collection_shorthand_with_locals + render :partial => [ Customer.new("david"), Customer.new("mary") ], :locals => { :greeting => "Bonjour" } + end + def empty_partial_collection render :partial => "customer", :collection => [] end @@ -708,6 +712,11 @@ EOS assert_equal "Bonjour: davidBonjour: mary", @response.body end + def test_partial_collection_shorthand_with_locals + get :partial_collection_shorthand_with_locals + assert_equal "Bonjour: davidBonjour: mary", @response.body + end + def test_empty_partial_collection get :empty_partial_collection assert_equal " ", @response.body |