From 49b6f33f99a28d68f18203a696fb47854a9085d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Sun, 10 Oct 2010 14:47:11 +0200 Subject: Clean up unused methods from AV::Base and pass in the template object on rendering. --- actionpack/test/template/template_test.rb | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'actionpack/test/template/template_test.rb') diff --git a/actionpack/test/template/template_test.rb b/actionpack/test/template/template_test.rb index 22401dd145..63f792d328 100644 --- a/actionpack/test/template/template_test.rb +++ b/actionpack/test/template/template_test.rb @@ -4,12 +4,14 @@ require "logger" class TestERBTemplate < ActiveSupport::TestCase ERBHandler = ActionView::Template::Handlers::ERB.new - class Context - class LookupContext - def disable_cache - yield - end + class LookupContext + def disable_cache + yield end + end + + class Context + attr_accessor :_template def initialize @output_buffer = "original" @@ -22,7 +24,7 @@ class TestERBTemplate < ActiveSupport::TestCase def partial ActionView::Template.new( - "<%= @_virtual_path %>", + "<%= @_template.virtual_path %>", "partial", ERBHandler, :virtual_path => "partial" @@ -84,9 +86,9 @@ class TestERBTemplate < ActiveSupport::TestCase end def test_virtual_path - @template = new_template("<%= @_virtual_path %>" \ + @template = new_template("<%= @_template.virtual_path %>" \ "<%= partial.render(self, {}) %>" \ - "<%= @_virtual_path %>") + "<%= @_template.virtual_path %>") assert_equal "hellopartialhello", render end -- cgit v1.2.3