aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/abstract_controller
diff options
context:
space:
mode:
authorYehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com>2009-04-27 18:21:26 -0700
committerYehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com>2009-05-01 17:31:01 -0700
commit8a4e77b4200946ba4ed42fe5927a7400a846063a (patch)
tree4d61ebd026f32bd9af32c93f93b3071232b1d8ee /actionpack/test/abstract_controller
parent34509777fd375e5bc529f21ca66cf63263c2cf64 (diff)
downloadrails-8a4e77b4200946ba4ed42fe5927a7400a846063a.tar.gz
rails-8a4e77b4200946ba4ed42fe5927a7400a846063a.tar.bz2
rails-8a4e77b4200946ba4ed42fe5927a7400a846063a.zip
OMG, a lot of work
Diffstat (limited to 'actionpack/test/abstract_controller')
-rw-r--r--actionpack/test/abstract_controller/abstract_controller_test.rb22
-rw-r--r--actionpack/test/abstract_controller/layouts_test.rb2
2 files changed, 10 insertions, 14 deletions
diff --git a/actionpack/test/abstract_controller/abstract_controller_test.rb b/actionpack/test/abstract_controller/abstract_controller_test.rb
index 331797afcf..cf6fb5140d 100644
--- a/actionpack/test/abstract_controller/abstract_controller_test.rb
+++ b/actionpack/test/abstract_controller/abstract_controller_test.rb
@@ -58,11 +58,11 @@ module AbstractController
end
def rendering_to_body
- render_to_body "naked_render.erb"
+ self.response_body = render_to_body :_template_name => "naked_render.erb"
end
def rendering_to_string
- render_to_string "naked_render.erb"
+ self.response_body = render_to_string :_template_name => "naked_render.erb"
end
end
@@ -136,6 +136,11 @@ module AbstractController
class WithLayouts < PrefixedViews
use Layouts
+ def self.inherited(klass)
+ klass._write_layout_method
+ super
+ end
+
private
def self.layout(formats)
begin
@@ -147,13 +152,9 @@ module AbstractController
end
end
end
-
- def _layout
- self.class.layout(formats)
- end
-
+
def render_to_body(options = {})
- options[:_layout] = options[:layout] || _layout
+ options[:_layout] = options[:layout] || _default_layout
super
end
end
@@ -175,11 +176,6 @@ module AbstractController
result = Me4.process(:index)
assert_equal "Me4 Enter : Hello from me4/index.erb : Exit", result.response_obj[:body]
end
-
- test "it can fall back to the application layout" do
- result = Me5.process(:index)
- assert_equal "Application Enter : Hello from me5/index.erb : Exit", result.response_obj[:body]
- end
end
# respond_to_action?(action_name)
diff --git a/actionpack/test/abstract_controller/layouts_test.rb b/actionpack/test/abstract_controller/layouts_test.rb
index 3d4570bfef..078e0037a8 100644
--- a/actionpack/test/abstract_controller/layouts_test.rb
+++ b/actionpack/test/abstract_controller/layouts_test.rb
@@ -8,7 +8,7 @@ module AbstractControllerTests
use AbstractController::Renderer
use AbstractController::Layouts
- self.view_paths = [ActionView::FixtureTemplate::FixturePath.new(
+ self.view_paths = [ActionView::Template::FixturePath.new(
"layouts/hello.erb" => "With String <%= yield %>",
"layouts/hello_override.erb" => "With Override <%= yield %>",
"layouts/abstract_controller_tests/layouts/with_string_implied_child.erb" =>