diff options
author | Pratik Naik <pratiknaik@gmail.com> | 2009-05-20 21:15:06 +0200 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2009-05-20 21:15:06 +0200 |
commit | c03b0ca7eb7e73587005e1440bf90cd01ed10aa5 (patch) | |
tree | 508196be70cad42b4debce6103fb5f5e2b3c5cbe /actionpack/test/new_base/render_layout_test.rb | |
parent | 6761759a90c08b9db8d5720a8ee4c4329a547caf (diff) | |
download | rails-c03b0ca7eb7e73587005e1440bf90cd01ed10aa5.tar.gz rails-c03b0ca7eb7e73587005e1440bf90cd01ed10aa5.tar.bz2 rails-c03b0ca7eb7e73587005e1440bf90cd01ed10aa5.zip |
Replace the class level Rack::Test DSL with the regular integration tests DSL
Diffstat (limited to 'actionpack/test/new_base/render_layout_test.rb')
-rw-r--r-- | actionpack/test/new_base/render_layout_test.rb | 64 |
1 files changed, 30 insertions, 34 deletions
diff --git a/actionpack/test/new_base/render_layout_test.rb b/actionpack/test/new_base/render_layout_test.rb index dc858b4f5c..76bd5175a3 100644 --- a/actionpack/test/new_base/render_layout_test.rb +++ b/actionpack/test/new_base/render_layout_test.rb @@ -2,69 +2,65 @@ require File.join(File.expand_path(File.dirname(__FILE__)), "test_helper") module ControllerLayouts class ImplicitController < ::ApplicationController - self.view_paths = [ActionView::Template::FixturePath.new( "layouts/application.html.erb" => "OMG <%= yield %> KTHXBAI", "layouts/override.html.erb" => "Override! <%= yield %>", "basic.html.erb" => "Hello world!", "controller_layouts/implicit/layout_false.html.erb" => "hai(layout_false.html.erb)" )] - + def index render :template => "basic" end - + def override render :template => "basic", :layout => "override" end - + def layout_false render :layout => false end - + def builder_override - end end - - class TestImplicitLayout < SimpleRouteCase - describe "rendering a normal template, but using the implicit layout" - - get "/controller_layouts/implicit/index" - assert_body "OMG Hello world! KTHXBAI" - assert_status 200 - end - + class ImplicitNameController < ::ApplicationController - self.view_paths = [ActionView::Template::FixturePath.new( "layouts/controller_layouts/implicit_name.html.erb" => "OMGIMPLICIT <%= yield %> KTHXBAI", "basic.html.erb" => "Hello world!" )] - + def index render :template => "basic" end end - - class TestImplicitNamedLayout < SimpleRouteCase - describe "rendering a normal template, but using an implicit NAMED layout" - - get "/controller_layouts/implicit_name/index" - assert_body "OMGIMPLICIT Hello world! KTHXBAI" - assert_status 200 - end - - class TestOverridingImplicitLayout < SimpleRouteCase - describe "overriding an implicit layout with render :layout option" - - get "/controller_layouts/implicit/override" - assert_body "Override! Hello world!" + + class RenderLayoutTest < SimpleRouteCase + test "rendering a normal template, but using the implicit layout" do + get "/controller_layouts/implicit/index" + + assert_body "OMG Hello world! KTHXBAI" + assert_status 200 + end + + test "rendering a normal template, but using an implicit NAMED layout" do + get "/controller_layouts/implicit_name/index" + + assert_body "OMGIMPLICIT Hello world! KTHXBAI" + assert_status 200 + end + + test "overriding an implicit layout with render :layout option" do + get "/controller_layouts/implicit/override" + assert_body "Override! Hello world!" + end + end - - class TestLayoutOptions < SimpleRouteCase + + class LayoutOptionsTest < SimpleRouteCase testing ControllerLayouts::ImplicitController - + test "rendering with :layout => false leaves out the implicit layout" do get :layout_false assert_response "hai(layout_false.html.erb)" |