mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
Reuse the view_context from the controller, this make the test environment more similar to the code applications uses
This commit is contained in:
@@ -156,11 +156,8 @@ module ActionView
|
||||
# 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
|
||||
|
||||
Reference in New Issue
Block a user