From 13df194c002f362556560303da9c73a24ebb189e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Sun, 1 May 2011 19:39:57 +0200 Subject: Tidy up pending TODOs after discussion with Mr. Gatoz (@wycats). --- actionpack/test/controller/new_base/render_context_test.rb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'actionpack/test/controller') 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 -- cgit v1.2.3