diff options
author | Pratik Naik <pratiknaik@gmail.com> | 2008-07-02 16:38:50 +0100 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2008-07-02 16:40:42 +0100 |
commit | 2b43620e3c1352028f19550fcde4632d65cbd191 (patch) | |
tree | b28ddcc92eae7fe9ceea11c2f55b1956f5d4efc7 /actionpack/test/template | |
parent | 4f75840d72b96fff34d65b59480da7d6c7494120 (diff) | |
download | rails-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/template')
-rw-r--r-- | actionpack/test/template/render_test.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/actionpack/test/template/render_test.rb b/actionpack/test/template/render_test.rb index 54e4bbda1b..64244e50f7 100644 --- a/actionpack/test/template/render_test.rb +++ b/actionpack/test/template/render_test.rb @@ -54,6 +54,11 @@ class ViewRenderTest < Test::Unit::TestCase def test_render_partial_collection assert_equal "Hello: davidHello: mary", @view.render(:partial => "test/customer", :collection => [ Customer.new("david"), Customer.new("mary") ]) end + + def test_render_partial_collection_as + assert_equal "david david davidmary mary mary", + @view.render(:partial => "test/customer_with_var", :collection => [ Customer.new("david"), Customer.new("mary") ], :as => :customer) + end # TODO: The reason for this test is unclear, improve documentation def test_render_partial_and_fallback_to_layout |