aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/template/template_test.rb
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2010-10-10 14:47:11 +0200
committerJosé Valim <jose.valim@gmail.com>2010-10-10 14:47:11 +0200
commit49b6f33f99a28d68f18203a696fb47854a9085d2 (patch)
tree4695f8b563d682ad3fb78d12ebfb547f378043eb /actionpack/test/template/template_test.rb
parent11aa5157355d06ddbc9cad8fd0aa43a75ac8431e (diff)
downloadrails-49b6f33f99a28d68f18203a696fb47854a9085d2.tar.gz
rails-49b6f33f99a28d68f18203a696fb47854a9085d2.tar.bz2
rails-49b6f33f99a28d68f18203a696fb47854a9085d2.zip
Clean up unused methods from AV::Base and pass in the template object on rendering.
Diffstat (limited to 'actionpack/test/template/template_test.rb')
-rw-r--r--actionpack/test/template/template_test.rb18
1 files changed, 10 insertions, 8 deletions
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