aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/template/render_test.rb
diff options
context:
space:
mode:
authorRyan Bates <ryan@railscasts.com>2008-08-22 08:04:27 -0700
committerPratik Naik <pratiknaik@gmail.com>2008-08-22 18:15:53 +0100
commit9a5ffaa01e5a13d9ec2209a1a937d46fc12615a1 (patch)
tree79c0e40f315ce708e0ff75b4455557cfb0ce44ee /actionpack/test/template/render_test.rb
parent4e4277b9e0a77c62dd1e253156bcde9e4a1a16b2 (diff)
downloadrails-9a5ffaa01e5a13d9ec2209a1a937d46fc12615a1.tar.gz
rails-9a5ffaa01e5a13d9ec2209a1a937d46fc12615a1.tar.bz2
rails-9a5ffaa01e5a13d9ec2209a1a937d46fc12615a1.zip
Ensure :partial => @collection and :collection => @collection behaves same. [#884 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
Diffstat (limited to 'actionpack/test/template/render_test.rb')
-rw-r--r--actionpack/test/template/render_test.rb4
1 files changed, 4 insertions, 0 deletions
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" })