diff options
author | Carlhuda <carlhuda@engineyard.com> | 2010-03-18 18:12:04 -0700 |
---|---|---|
committer | Carlhuda <carlhuda@engineyard.com> | 2010-03-18 18:14:54 -0700 |
commit | a5d80f84d269bba6b0f0802612f29df1ee09d720 (patch) | |
tree | d5673cda114eeaab9dcbc7107d227f6c83f2c2f3 /actionpack/lib/action_dispatch/testing/assertions | |
parent | e629e21135d9d0e87c02e1106e489f943f19d2d9 (diff) | |
download | rails-a5d80f84d269bba6b0f0802612f29df1ee09d720.tar.gz rails-a5d80f84d269bba6b0f0802612f29df1ee09d720.tar.bz2 rails-a5d80f84d269bba6b0f0802612f29df1ee09d720.zip |
Each controller class has it's own view context subclass. This removes the need for ActionView::Base.for_controller
Diffstat (limited to 'actionpack/lib/action_dispatch/testing/assertions')
-rw-r--r-- | actionpack/lib/action_dispatch/testing/assertions/routing.rb | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/actionpack/lib/action_dispatch/testing/assertions/routing.rb b/actionpack/lib/action_dispatch/testing/assertions/routing.rb index de833bb3ca..1bb81ede3b 100644 --- a/actionpack/lib/action_dispatch/testing/assertions/routing.rb +++ b/actionpack/lib/action_dispatch/testing/assertions/routing.rb @@ -153,15 +153,16 @@ module ActionDispatch # # TODO: Make this unnecessary if @controller - @controller.singleton_class.send(:include, @router.url_helpers) - @controller.class._helper_serial = AbstractController::Helpers.next_serial + 1 + @controller.singleton_class.send(:include, _router.url_helpers) + @controller.view_context_class = Class.new(@controller.view_context_class) do + include _router.url_helpers + end end yield @router ensure @router = old_routes if @controller @controller = old_controller - @controller.class._helper_serial = AbstractController::Helpers.next_serial + 1 if @controller end end |