diff options
author | Yehuda Katz and Carl Lerche <wycats@gmail.com> | 2009-04-07 17:57:20 -0700 |
---|---|---|
committer | Yehuda Katz and Carl Lerche <wycats@gmail.com> | 2009-04-07 17:57:20 -0700 |
commit | 3cecbc21e37f772a72917f80c53a7645f81d94c5 (patch) | |
tree | fbdb4e9a6934e066ecc14e06b7f76202d54e29b1 /actionpack/test/new_base/render_layout_test.rb | |
parent | 95c9718118bc0342ddb320f23b5e0a17fb12b7ad (diff) | |
download | rails-3cecbc21e37f772a72917f80c53a7645f81d94c5.tar.gz rails-3cecbc21e37f772a72917f80c53a7645f81d94c5.tar.bz2 rails-3cecbc21e37f772a72917f80c53a7645f81d94c5.zip |
Get Base2 layouts to work :)
Diffstat (limited to 'actionpack/test/new_base/render_layout_test.rb')
-rw-r--r-- | actionpack/test/new_base/render_layout_test.rb | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/actionpack/test/new_base/render_layout_test.rb b/actionpack/test/new_base/render_layout_test.rb index e69de29bb2..facf67ea85 100644 --- a/actionpack/test/new_base/render_layout_test.rb +++ b/actionpack/test/new_base/render_layout_test.rb @@ -0,0 +1,45 @@ +require File.join(File.expand_path(File.dirname(__FILE__)), "test_helper") + +module ControllerLayouts + class ImplicitController < ::ApplicationController + + self.view_paths = [ActionView::FixtureTemplate::FixturePath.new( + "layouts/application.html.erb" => "OMG <%= yield %> KTHXBAI", + "basic.html.erb" => "Hello world!" + )] + + def index + render :template => "basic" + 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::FixtureTemplate::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 + + +end
\ No newline at end of file |