aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/dispatch/routing/ipv6_redirect_test.rb
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2018-09-24 11:30:15 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2018-09-25 09:43:25 -0700
commit8dc784292b67b842e437632a4ff883572ff97a3e (patch)
tree3e2d227319a2214b05cce94271290dc743989f97 /actionpack/test/dispatch/routing/ipv6_redirect_test.rb
parentd34bd0d2d55e33c757abd55fdd07ff575f68f185 (diff)
downloadrails-8dc784292b67b842e437632a4ff883572ff97a3e.tar.gz
rails-8dc784292b67b842e437632a4ff883572ff97a3e.tar.bz2
rails-8dc784292b67b842e437632a4ff883572ff97a3e.zip
Eagerly build the routing helper module after routes are committed
This commit eagerly builds the route helper module after the routes have been drawn and finalized. This allows us to cache the helper module but not have to worry about people accessing the module while route definition is "in-flight", and automatically deals with cache invalidation as the module is regenerated anytime someone redraws the routes. The restriction this commit introduces is that the url helper module can only be accessed *after* the routes are done being drawn. Refs #24554 and #32892
Diffstat (limited to 'actionpack/test/dispatch/routing/ipv6_redirect_test.rb')
-rw-r--r--actionpack/test/dispatch/routing/ipv6_redirect_test.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/actionpack/test/dispatch/routing/ipv6_redirect_test.rb b/actionpack/test/dispatch/routing/ipv6_redirect_test.rb
index 31559bffc7..fb423d2951 100644
--- a/actionpack/test/dispatch/routing/ipv6_redirect_test.rb
+++ b/actionpack/test/dispatch/routing/ipv6_redirect_test.rb
@@ -4,6 +4,11 @@ require "abstract_unit"
class IPv6IntegrationTest < ActionDispatch::IntegrationTest
Routes = ActionDispatch::Routing::RouteSet.new
+ Routes.draw do
+ get "/", to: "bad_route_request#index", as: :index
+ get "/foo", to: "bad_route_request#foo", as: :foo
+ end
+
include Routes.url_helpers
class ::BadRouteRequestController < ActionController::Base
@@ -17,11 +22,6 @@ class IPv6IntegrationTest < ActionDispatch::IntegrationTest
end
end
- Routes.draw do
- get "/", to: "bad_route_request#index", as: :index
- get "/foo", to: "bad_route_request#foo", as: :foo
- end
-
def _routes
Routes
end