aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/test_case.rb
diff options
context:
space:
mode:
authorSantiago Pastorino <santiago@wyeworks.com>2011-01-12 16:44:56 -0200
committerSantiago Pastorino <santiago@wyeworks.com>2011-01-12 16:47:56 -0200
commitdaada51d1051948c3e6de963a90c4b5bb5bf142b (patch)
tree94d508fa0518a03bbbab21a8800a2e809109952c /actionpack/lib/action_view/test_case.rb
parent6ddabaa90c512abf4d319056ce296fa75216623e (diff)
downloadrails-daada51d1051948c3e6de963a90c4b5bb5bf142b.tar.gz
rails-daada51d1051948c3e6de963a90c4b5bb5bf142b.tar.bz2
rails-daada51d1051948c3e6de963a90c4b5bb5bf142b.zip
Reuse the view_context from the controller, this make the test environment more similar to the code applications uses
Diffstat (limited to 'actionpack/lib/action_view/test_case.rb')
-rw-r--r--actionpack/lib/action_view/test_case.rb5
1 files changed, 1 insertions, 4 deletions
diff --git a/actionpack/lib/action_view/test_case.rb b/actionpack/lib/action_view/test_case.rb
index 72d17143f5..d4f16d4b36 100644
--- a/actionpack/lib/action_view/test_case.rb
+++ b/actionpack/lib/action_view/test_case.rb
@@ -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