diff options
author | wycats <wycats@gmail.com> | 2010-03-26 15:10:24 -0700 |
---|---|---|
committer | wycats <wycats@gmail.com> | 2010-03-26 15:10:24 -0700 |
commit | 197904341f2b2f21d69c653cede3aec124e86720 (patch) | |
tree | 83f1234e238016126860a929594db22e1862d783 /actionpack/lib/action_view/test_case.rb | |
parent | 76d2c455c0607b4cd5f238cadef8f933a18567fb (diff) | |
parent | b3a0aed028835ce4551c4a76742744a40a71b0be (diff) | |
download | rails-197904341f2b2f21d69c653cede3aec124e86720.tar.gz rails-197904341f2b2f21d69c653cede3aec124e86720.tar.bz2 rails-197904341f2b2f21d69c653cede3aec124e86720.zip |
Merge branch 'master' into docrails
Diffstat (limited to 'actionpack/lib/action_view/test_case.rb')
-rw-r--r-- | actionpack/lib/action_view/test_case.rb | 29 |
1 files changed, 6 insertions, 23 deletions
diff --git a/actionpack/lib/action_view/test_case.rb b/actionpack/lib/action_view/test_case.rb index 1578ac9479..b0ababe344 100644 --- a/actionpack/lib/action_view/test_case.rb +++ b/actionpack/lib/action_view/test_case.rb @@ -2,29 +2,10 @@ require 'action_controller/test_case' require 'action_view' module ActionView - class Base - alias_method :initialize_without_template_tracking, :initialize - def initialize(*args) - @_rendered = { :template => nil, :partials => Hash.new(0) } - initialize_without_template_tracking(*args) - end - - attr_internal :rendered - end - - class Template - alias_method :render_without_tracking, :render - def render(view, locals, &blk) - rendered = view.rendered - rendered[:partials][self] += 1 if partial? - rendered[:template] ||= [] - rendered[:template] << self - render_without_tracking(view, locals, &blk) - end - end - class TestCase < ActiveSupport::TestCase class TestController < ActionController::Base + include ActionDispatch::TestProcess + attr_accessor :request, :response, :params def self.controller_path @@ -42,6 +23,7 @@ module ActionView end include ActionDispatch::Assertions, ActionDispatch::TestProcess + include ActionController::TemplateAssertions include ActionView::Context include ActionController::PolymorphicRoutes @@ -64,7 +46,7 @@ module ActionView end def config - @controller.config + @controller.config if @controller.respond_to?(:config) end def render(options = {}, local_assigns = {}, &block) @@ -124,7 +106,8 @@ module ActionView def _view view = ActionView::Base.new(ActionController::Base.view_paths, _assigns, @controller) - view.class.send :include, _helpers + view.singleton_class.send :include, _helpers + view.singleton_class.send :include, @controller._router.url_helpers view.output_buffer = self.output_buffer view end |