From 5360e4743158c2a0eb91d73f1bcc954c2cb7f5e7 Mon Sep 17 00:00:00 2001 From: Rick Olson Date: Wed, 6 Sep 2006 03:51:45 +0000 Subject: added passing test for using partials with an xml builder git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5044 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/test/controller/render_test.rb | 9 +++++++++ actionpack/test/fixtures/test/_hello.rxml | 1 + actionpack/test/fixtures/test/hello_world_container.rxml | 3 +++ 3 files changed, 13 insertions(+) create mode 100644 actionpack/test/fixtures/test/_hello.rxml create mode 100644 actionpack/test/fixtures/test/hello_world_container.rxml (limited to 'actionpack') diff --git a/actionpack/test/controller/render_test.rb b/actionpack/test/controller/render_test.rb index c22702acd0..23f90c6243 100644 --- a/actionpack/test/controller/render_test.rb +++ b/actionpack/test/controller/render_test.rb @@ -60,6 +60,10 @@ class TestController < ActionController::Base render_action "hello" end + def builder_partial_test + render_action "hello_world_container" + end + def partials_list @test_unchanged = 'hello' @customers = [ Customer.new("david"), Customer.new("mary") ] @@ -193,6 +197,11 @@ class RenderTest < Test::Unit::TestCase assert_equal "

This is grand!

\n", @response.body end + def test_render_xml_with_partial + get :builder_partial_test + assert_equal "\n \n\n", @response.body + end + def test_layout_rendering get :layout_test assert_equal "Hello world!", @response.body diff --git a/actionpack/test/fixtures/test/_hello.rxml b/actionpack/test/fixtures/test/_hello.rxml new file mode 100644 index 0000000000..ef52f632d1 --- /dev/null +++ b/actionpack/test/fixtures/test/_hello.rxml @@ -0,0 +1 @@ +xm.hello \ No newline at end of file diff --git a/actionpack/test/fixtures/test/hello_world_container.rxml b/actionpack/test/fixtures/test/hello_world_container.rxml new file mode 100644 index 0000000000..e48d75c405 --- /dev/null +++ b/actionpack/test/fixtures/test/hello_world_container.rxml @@ -0,0 +1,3 @@ +xml.test do + render :partial => 'hello', :locals => { :xm => xml } +end \ No newline at end of file -- cgit v1.2.3