diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-07-27 09:11:00 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-07-27 09:11:00 +0000 |
commit | e95dd53a5d909338a8cf7720989d16b2620f78e2 (patch) | |
tree | 143aa1cacae5dba20db0ca811d8d8ff4b69c5933 /actionpack/test/controller | |
parent | d876daf51f0ac141eb0152a1233c9b3a11fc4bd4 (diff) | |
download | rails-e95dd53a5d909338a8cf7720989d16b2620f78e2.tar.gz rails-e95dd53a5d909338a8cf7720989d16b2620f78e2.tar.bz2 rails-e95dd53a5d909338a8cf7720989d16b2620f78e2.zip |
Added two failing tests for partials with locals from controller
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1937 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test/controller')
-rw-r--r-- | actionpack/test/controller/new_render_test.rb | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/actionpack/test/controller/new_render_test.rb b/actionpack/test/controller/new_render_test.rb index b2e3b6b399..6d2aa2cd2d 100644 --- a/actionpack/test/controller/new_render_test.rb +++ b/actionpack/test/controller/new_render_test.rb @@ -81,6 +81,18 @@ class NewRenderTestController < ActionController::Base def partial_only_with_layout render :partial => "partial_only", :layout => true end + + def partial_with_locals + render :partial => "customer", :locals => { :customer => Customer.new("david") } + end + + def partial_collection + render :partial => "customer", :collection => [ Customer.new("david"), Customer.new("mary") ] + end + + def partial_collection_with_locals + render :partial => "customer", :collection => [ Customer.new("david"), Customer.new("mary") ], :locals => { :extra => ", fun!" } + end def hello_in_a_string @customers = [ Customer.new("david"), Customer.new("mary") ] @@ -315,4 +327,19 @@ class NewRenderTest < Test::Unit::TestCase get :partials_list assert_equal "goodbyeHello: davidHello: marygoodbye\n", @response.body end + + def test_partial_with_locals + get :partial_with_locals + assert_equal "Hello: David", @response.body + end + + def test_partial_collection + get :partial_collection + assert_equal "Hello: davidHello: mary", @response.body + end + + def test_partial_collection_with_locals + get :partial_collection_with_locals + assert_equal "Hello: david, fun!Hello: mary, fun!", @response.body + end end
\ No newline at end of file |