aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller/new_render_test.rb
diff options
context:
space:
mode:
authorPratik Naik <pratiknaik@gmail.com>2008-07-02 16:38:50 +0100
committerPratik Naik <pratiknaik@gmail.com>2008-07-02 16:40:42 +0100
commit2b43620e3c1352028f19550fcde4632d65cbd191 (patch)
treeb28ddcc92eae7fe9ceea11c2f55b1956f5d4efc7 /actionpack/test/controller/new_render_test.rb
parent4f75840d72b96fff34d65b59480da7d6c7494120 (diff)
downloadrails-2b43620e3c1352028f19550fcde4632d65cbd191.tar.gz
rails-2b43620e3c1352028f19550fcde4632d65cbd191.tar.bz2
rails-2b43620e3c1352028f19550fcde4632d65cbd191.zip
Add :as option to render a collection of partials with a custom local variable name. [#509 state:resolved] [Simon Jefford, Pratik Naik]
Diffstat (limited to 'actionpack/test/controller/new_render_test.rb')
-rw-r--r--actionpack/test/controller/new_render_test.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/actionpack/test/controller/new_render_test.rb b/actionpack/test/controller/new_render_test.rb
index eac36a04cb..5a7da57559 100644
--- a/actionpack/test/controller/new_render_test.rb
+++ b/actionpack/test/controller/new_render_test.rb
@@ -152,6 +152,10 @@ class NewRenderTestController < ActionController::Base
render :partial => "customer", :collection => [ Customer.new("david"), Customer.new("mary") ]
end
+ def partial_collection_with_as
+ render :partial => "customer_with_var", :collection => [ Customer.new("david"), Customer.new("mary") ], :as => :customer
+ end
+
def partial_collection_with_spacer
render :partial => "customer", :spacer_template => "partial_only", :collection => [ Customer.new("david"), Customer.new("mary") ]
end
@@ -763,6 +767,11 @@ EOS
assert_equal "Hello: davidHello: mary", @response.body
end
+ def test_partial_collection_with_as
+ get :partial_collection_with_as
+ assert_equal "david david davidmary mary mary", @response.body
+ end
+
def test_partial_collection_with_counter
get :partial_collection_with_counter
assert_equal "david0mary1", @response.body