aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller/new_base
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2011-05-01 19:39:57 +0200
committerJosé Valim <jose.valim@gmail.com>2011-05-01 19:39:57 +0200
commit13df194c002f362556560303da9c73a24ebb189e (patch)
treee3eca086931009829feadb10aafdc6d28570c98b /actionpack/test/controller/new_base
parent8dbee3aba6920edcae20abf3af7f803e528f9ee0 (diff)
downloadrails-13df194c002f362556560303da9c73a24ebb189e.tar.gz
rails-13df194c002f362556560303da9c73a24ebb189e.tar.bz2
rails-13df194c002f362556560303da9c73a24ebb189e.zip
Tidy up pending TODOs after discussion with Mr. Gatoz (@wycats).
Diffstat (limited to 'actionpack/test/controller/new_base')
-rw-r--r--actionpack/test/controller/new_base/render_context_test.rb14
1 files changed, 7 insertions, 7 deletions
diff --git a/actionpack/test/controller/new_base/render_context_test.rb b/actionpack/test/controller/new_base/render_context_test.rb
index 3174bf42ab..f41b14d5d6 100644
--- a/actionpack/test/controller/new_base/render_context_test.rb
+++ b/actionpack/test/controller/new_base/render_context_test.rb
@@ -1,5 +1,8 @@
require 'abstract_unit'
+# This is testing the decoupling of view renderer and view context
+# by allowing the controller to be used as view context. This is
+# similar to the way sinatra renders templates.
module RenderContext
class BasicController < ActionController::Base
self.view_paths = [ActionView::FixtureResolver.new(
@@ -7,15 +10,11 @@ module RenderContext
"layouts/basic.html.erb" => "?<%= yield %>?"
)]
- # Include ViewContext
+ # 1) Include ActionView::Context to bring the required dependencies
include ActionView::Context
- # And initialize the required variables
- before_filter do
- @output_buffer = nil
- @virtual_path = nil
- @view_flow = ActionView::OutputFlow.new
- end
+ # 2) Call _prepare_context that will do the required initialization
+ before_filter :_prepare_context
def hello_world
@value = "Hello"
@@ -29,6 +28,7 @@ module RenderContext
protected
+ # 3) Set view_context to self
def view_context
self
end