Skip to content

Commit

Permalink
Reuse the view_context from the controller, this make the test enviro…
Browse files Browse the repository at this point in the history
…nment more similar to the code applications uses
  • Loading branch information
spastorino committed Jan 12, 2011
1 parent 58f90b2 commit acecf00
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions actionpack/lib/action_view/test_case.rb
Expand Up @@ -153,11 +153,8 @@ def _render_partial(options)
# The instance of ActionView::Base that is used by +render+. # The instance of ActionView::Base that is used by +render+.
def view def view
@view ||= begin @view ||= begin
view = ActionView::Base.new(ActionController::Base.view_paths, {}, @controller) view = @controller.view_context
view.singleton_class.send :include, @controller._helpers
view.singleton_class.send :include, _helpers 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.extend(Locals)
view.locals = self.locals view.locals = self.locals
view.output_buffer = self.output_buffer view.output_buffer = self.output_buffer
Expand Down

0 comments on commit acecf00

Please sign in to comment.