From f08b58dd0c0ad860bb119bde94a46c6330ca1556 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim=20=26=20Carlos=20Antonio=20da=20Silva?= Date: Wed, 11 Aug 2010 10:23:07 -0300 Subject: layout_for works again with objects as specified in the documentation and Rails 2.3 [#5357 state:resolved] --- actionpack/test/fixtures/layouts/_customers.erb | 1 + actionpack/test/fixtures/test/layout_render_object.erb | 1 + actionpack/test/template/render_test.rb | 5 +++++ 3 files changed, 7 insertions(+) create mode 100644 actionpack/test/fixtures/layouts/_customers.erb create mode 100644 actionpack/test/fixtures/test/layout_render_object.erb (limited to 'actionpack/test') diff --git a/actionpack/test/fixtures/layouts/_customers.erb b/actionpack/test/fixtures/layouts/_customers.erb new file mode 100644 index 0000000000..ae63f13cd3 --- /dev/null +++ b/actionpack/test/fixtures/layouts/_customers.erb @@ -0,0 +1 @@ +<%= yield Struct.new(:name).new("David") %> \ No newline at end of file diff --git a/actionpack/test/fixtures/test/layout_render_object.erb b/actionpack/test/fixtures/test/layout_render_object.erb new file mode 100644 index 0000000000..acc4453c08 --- /dev/null +++ b/actionpack/test/fixtures/test/layout_render_object.erb @@ -0,0 +1 @@ +<%= render :layout => "layouts/customers" do |customer| %><%= customer.name %><% end %> \ No newline at end of file diff --git a/actionpack/test/template/render_test.rb b/actionpack/test/template/render_test.rb index 059dcedad8..60d4d9f4a7 100644 --- a/actionpack/test/template/render_test.rb +++ b/actionpack/test/template/render_test.rb @@ -252,6 +252,11 @@ module RenderTestCases assert_equal %(\ntitle\n\n), @view.render(:file => "test/layout_render_file.erb") end + + def test_render_layout_with_object + assert_equal %(David), + @view.render(:file => "test/layout_render_object.erb") + end end class CachedViewRenderTest < ActiveSupport::TestCase -- cgit v1.2.3