aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorMichael Koziarski <michael@koziarski.com>2010-10-08 11:12:11 +1300
committerMichael Koziarski <michael@koziarski.com>2010-10-08 11:12:11 +1300
commit581b2b68368e3330cc725a305d0e2465c2e71e1c (patch)
tree6e6e6df132e6e9334f29bbf2f738b0bd7531be81 /actionpack/test
parentc7760809bfc8e19362272b71b23a294d48195d65 (diff)
downloadrails-581b2b68368e3330cc725a305d0e2465c2e71e1c.tar.gz
rails-581b2b68368e3330cc725a305d0e2465c2e71e1c.tar.bz2
rails-581b2b68368e3330cc725a305d0e2465c2e71e1c.zip
fix rendering a partial with an array as its :object [#5746 state:resolved]
Signed-off-by: Michael Koziarski <michael@koziarski.com> Conflicts: actionpack/lib/action_view/render/partials.rb
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/fixtures/test/_object_inspector.erb1
-rw-r--r--actionpack/test/template/render_test.rb4
2 files changed, 5 insertions, 0 deletions
diff --git a/actionpack/test/fixtures/test/_object_inspector.erb b/actionpack/test/fixtures/test/_object_inspector.erb
new file mode 100644
index 0000000000..53af593821
--- /dev/null
+++ b/actionpack/test/fixtures/test/_object_inspector.erb
@@ -0,0 +1 @@
+<%= object_inspector.inspect -%> \ No newline at end of file
diff --git a/actionpack/test/template/render_test.rb b/actionpack/test/template/render_test.rb
index 205fdcf345..756d8d05d2 100644
--- a/actionpack/test/template/render_test.rb
+++ b/actionpack/test/template/render_test.rb
@@ -127,6 +127,10 @@ module RenderTestCases
assert_equal "Hello: david", @view.render(:partial => "test/customer", :object => Customer.new("david"))
end
+ def test_render_object_with_array
+ assert_equal "[1, 2, 3]", @view.render(:partial => "test/object_inspector", :object => [1, 2, 3])
+ end
+
def test_render_partial_collection
assert_equal "Hello: davidHello: mary", @view.render(:partial => "test/customer", :collection => [ Customer.new("david"), Customer.new("mary") ])
end