diff options
author | Yehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com> | 2009-05-14 15:30:35 -0700 |
---|---|---|
committer | Yehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com> | 2009-05-14 15:30:35 -0700 |
commit | 8fac2c88cae0f2fd42fad3c2c2c6c860df14d629 (patch) | |
tree | d959ad5fa6cf72cc8c887cdf1ebdfe2ddea94bc4 /actionpack/test/new_base/render_action_test.rb | |
parent | 49a84ff69ca4fc4db821ca3b5a5926d07832c845 (diff) | |
download | rails-8fac2c88cae0f2fd42fad3c2c2c6c860df14d629.tar.gz rails-8fac2c88cae0f2fd42fad3c2c2c6c860df14d629.tar.bz2 rails-8fac2c88cae0f2fd42fad3c2c2c6c860df14d629.zip |
Cleaning up more render tests
Diffstat (limited to 'actionpack/test/new_base/render_action_test.rb')
-rw-r--r-- | actionpack/test/new_base/render_action_test.rb | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/actionpack/test/new_base/render_action_test.rb b/actionpack/test/new_base/render_action_test.rb index 348d70381b..f25faee433 100644 --- a/actionpack/test/new_base/render_action_test.rb +++ b/actionpack/test/new_base/render_action_test.rb @@ -131,8 +131,10 @@ module RenderActionWithApplicationLayout # Set the view path to an application view structure with layouts self.view_paths = self.view_paths = [ActionView::Template::FixturePath.new( "render_action_with_application_layout/basic/hello_world.html.erb" => "Hello World!", + "render_action_with_application_layout/basic/hello.html.builder" => "xml.p 'Omg'", "layouts/application.html.erb" => "OHAI <%= yield %> KTHXBAI", - "layouts/greetings.html.erb" => "Greetings <%= yield %> Bai" + "layouts/greetings.html.erb" => "Greetings <%= yield %> Bai", + "layouts/builder.html.builder" => "xml.html do\n xml << yield\nend" )] def hello_world @@ -154,6 +156,10 @@ module RenderActionWithApplicationLayout def hello_world_with_custom_layout render :action => "hello_world", :layout => "greetings" end + + def with_builder_and_layout + render :action => "hello", :layout => "builder" + end end class TestDefaultLayout < SimpleRouteCase @@ -199,6 +205,15 @@ module RenderActionWithApplicationLayout assert_status 200 end + class TestLayout < SimpleRouteCase + testing BasicController + + test "builder works with layouts" do + get :with_builder_and_layout + assert_response "<html>\n<p>Omg</p>\n</html>\n" + end + end + end module RenderActionWithControllerLayout |