From ba5995dcd983498aea342fd06ccb6337f3bd15ab Mon Sep 17 00:00:00 2001 From: Joshua Peek Date: Thu, 27 Aug 2009 12:43:26 -0500 Subject: Reset session in integration tests after changing routes to reload the middleware stack --- actionpack/lib/action_controller/testing/process.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'actionpack/lib/action_controller') diff --git a/actionpack/lib/action_controller/testing/process.rb b/actionpack/lib/action_controller/testing/process.rb index 6bc7d60d76..4185b803c5 100644 --- a/actionpack/lib/action_controller/testing/process.rb +++ b/actionpack/lib/action_controller/testing/process.rb @@ -249,6 +249,7 @@ module ActionController #:nodoc: temporary_routes = ActionController::Routing::RouteSet.new ActionController::Routing.module_eval { const_set :Routes, temporary_routes } + ActionController::Dispatcher.router = temporary_routes yield temporary_routes ensure @@ -256,6 +257,7 @@ module ActionController #:nodoc: ActionController::Routing.module_eval { remove_const :Routes } end ActionController::Routing.const_set(:Routes, real_routes) if real_routes + ActionController::Dispatcher.router = ActionController::Routing::Routes end end -end \ No newline at end of file +end -- cgit v1.2.3