Permalink
Browse files

Fix all of AP's tests with the non global router

  • Loading branch information...
1 parent 4b038f6 commit a278f2331007411b190d65577082d2710ad9a996 Carlhuda committed Feb 25, 2010
@@ -400,7 +400,7 @@ def with_test_routes(options = {})
map.resources :series
end
- ActionDispatch::Routing::Routes.install_helpers(self.class)
+ self.class.send(:include, @router.named_url_helpers)
yield
end
end
@@ -422,7 +422,7 @@ def with_admin_test_routes(options = {})
end
end
- ActionDispatch::Routing::Routes.install_helpers(self.class)
+ self.class.send(:include, @router.named_url_helpers)
yield
end
end
@@ -441,7 +441,7 @@ def with_admin_and_site_test_routes(options = {})
end
end
- ActionDispatch::Routing::Routes.install_helpers(self.class)
+ self.class.send(:include, @router.named_url_helpers)
yield
end
end
@@ -74,9 +74,9 @@ def test_page_caching_resources_saves_to_correct_path_with_extension_even_if_def
match '/', :to => 'posts#index', :as => :main
end
@params[:format] = 'rss'
- assert_equal '/posts.rss', @rewriter.rewrite(@params)
+ assert_equal '/posts.rss', @rewriter.rewrite(@router, @params)
@params[:format] = nil
- assert_equal '/', @rewriter.rewrite(@params)
+ assert_equal '/', @rewriter.rewrite(@router, @params)
end
end
@@ -511,6 +511,8 @@ def reset!
@request = ActionController::TestRequest.new
@response = ActionController::TestResponse.new
@controller = ActionCachingTestController.new
+ # ROUTES TODO: It seems bad to explicitly remix in the class
+ @controller.metaclass.send(:include, @router.named_url_helpers)
@request.host = 'hostname.com'
end

0 comments on commit a278f23

Please sign in to comment.