diff options
author | Aaron Patterson <tenderlove@github.com> | 2018-09-26 14:21:15 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-26 14:21:15 -0700 |
commit | 7f870a5ba2aa9177aa4a0e03a9d027928ba60e49 (patch) | |
tree | b4fb19def15c5033483ecebe25d4e762ee1a4dab /actionpack/test/dispatch | |
parent | 6556898884d636c59baae008e42783b8d3e16440 (diff) | |
parent | b42d246c5d020a46d5964d236eb7f0d857ef01e8 (diff) | |
download | rails-7f870a5ba2aa9177aa4a0e03a9d027928ba60e49.tar.gz rails-7f870a5ba2aa9177aa4a0e03a9d027928ba60e49.tar.bz2 rails-7f870a5ba2aa9177aa4a0e03a9d027928ba60e49.zip |
Merge pull request #33970 from rails/eager-url-helpers
Eagerly build the routing helper module after routes are committed
Diffstat (limited to 'actionpack/test/dispatch')
-rw-r--r-- | actionpack/test/dispatch/routing/ipv6_redirect_test.rb | 10 | ||||
-rw-r--r-- | actionpack/test/dispatch/url_generation_test.rb | 9 |
2 files changed, 10 insertions, 9 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 diff --git a/actionpack/test/dispatch/url_generation_test.rb b/actionpack/test/dispatch/url_generation_test.rb index aef9351de1..b0096d26be 100644 --- a/actionpack/test/dispatch/url_generation_test.rb +++ b/actionpack/test/dispatch/url_generation_test.rb @@ -4,16 +4,13 @@ require "abstract_unit" module TestUrlGeneration class WithMountPoint < ActionDispatch::IntegrationTest - Routes = ActionDispatch::Routing::RouteSet.new - include Routes.url_helpers - class ::MyRouteGeneratingController < ActionController::Base - include Routes.url_helpers def index render plain: foo_path end end + Routes = ActionDispatch::Routing::RouteSet.new Routes.draw do get "/foo", to: "my_route_generating#index", as: :foo @@ -22,6 +19,10 @@ module TestUrlGeneration mount MyRouteGeneratingController.action(:index), at: "/bar" end + class ::MyRouteGeneratingController + include Routes.url_helpers + end + APP = build_app Routes def _routes |