mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05: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:
parent
6ddabaa90c
commit
daada51d10
1 changed files with 1 additions and 4 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue