From acecf0059ef19846af045014759ed0eae471b9a8 Mon Sep 17 00:00:00 2001 From: Santiago Pastorino Date: Wed, 12 Jan 2011 16:44:56 -0200 Subject: [PATCH] Reuse the view_context from the controller, this make the test environment more similar to the code applications uses --- actionpack/lib/action_view/test_case.rb | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/actionpack/lib/action_view/test_case.rb b/actionpack/lib/action_view/test_case.rb index cd7f0c88fd400..f13c3cd6edefc 100644 --- a/actionpack/lib/action_view/test_case.rb +++ b/actionpack/lib/action_view/test_case.rb @@ -153,11 +153,8 @@ def _render_partial(options) # The instance of ActionView::Base that is used by +render+. def view @view ||= begin - view = ActionView::Base.new(ActionController::Base.view_paths, {}, @controller) - view.singleton_class.send :include, @controller._helpers + view = @controller.view_context view.singleton_class.send :include, _helpers - view.singleton_class.send :include, @controller._routes.url_helpers - view.singleton_class.send :delegate, :alert, :notice, :to => "request.flash" view.extend(Locals) view.locals = self.locals view.output_buffer = self.output_buffer