diff options
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/fixtures/test/_customer.erb | 2 | ||||
-rw-r--r-- | actionpack/test/template/render_test.rb | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/actionpack/test/fixtures/test/_customer.erb b/actionpack/test/fixtures/test/_customer.erb index 872d8c44e6..d8220afeda 100644 --- a/actionpack/test/fixtures/test/_customer.erb +++ b/actionpack/test/fixtures/test/_customer.erb @@ -1 +1 @@ -Hello: <%= customer.name %>
\ No newline at end of file +Hello: <%= customer.name rescue "Anonymous" %>
\ No newline at end of file diff --git a/actionpack/test/template/render_test.rb b/actionpack/test/template/render_test.rb index da8c782880..476e651757 100644 --- a/actionpack/test/template/render_test.rb +++ b/actionpack/test/template/render_test.rb @@ -115,6 +115,10 @@ class ViewRenderTest < Test::Unit::TestCase assert_nil @view.render(:partial => "test/customer", :collection => nil) end + def test_render_partial_with_nil_values_in_collection + assert_equal "Hello: davidHello: Anonymous", @view.render(:partial => "test/customer", :collection => [ Customer.new("david"), nil ]) + end + def test_render_partial_with_empty_array_should_return_nil assert_nil @view.render(:partial => []) end |