aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorJamis Buck <jamis@37signals.com>2005-09-01 21:43:38 +0000
committerJamis Buck <jamis@37signals.com>2005-09-01 21:43:38 +0000
commit01af965a3e68f719fe9cfdce36a82ad8901fe7a7 (patch)
tree61677831a35ffded12a7c133ad31b4b7a98e5aff /actionpack/test
parent49c67ea1b7411ea8c73fcba45fe15e76f8697282 (diff)
downloadrails-01af965a3e68f719fe9cfdce36a82ad8901fe7a7.tar.gz
rails-01af965a3e68f719fe9cfdce36a82ad8901fe7a7.tar.bz2
rails-01af965a3e68f719fe9cfdce36a82ad8901fe7a7.zip
Make rendering an empty partial collection behave like :nothing => true #2080 [Sam Stephenson]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2093 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test')
-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 a29a6b9cd2..7cb3643db5 100644
--- a/actionpack/test/controller/new_render_test.rb
+++ b/actionpack/test/controller/new_render_test.rb
@@ -98,6 +98,10 @@ class NewRenderTestController < ActionController::Base
render :partial => "customer_greeting", :collection => [ Customer.new("david"), Customer.new("mary") ], :locals => { :greeting => "Bonjour" }
end
+ def empty_partial_collection
+ render :partial => "customer", :collection => []
+ end
+
def hello_in_a_string
@customers = [ Customer.new("david"), Customer.new("mary") ]
render :text => "How's there? #{render_to_string("test/list")}"
@@ -358,6 +362,11 @@ class NewRenderTest < Test::Unit::TestCase
assert_equal "Bonjour: davidBonjour: mary", @response.body
end
+ def test_empty_partial_collection
+ get :empty_partial_collection
+ assert_equal " ", @response.body
+ end
+
def test_render_text_with_assigns
get :render_text_with_assigns
assert_equal "world", assigns["hello"]