From e6cf57df8a609c697c0bc593576f06895414da64 Mon Sep 17 00:00:00 2001 From: Edouard CHIN Date: Wed, 24 Jul 2019 00:28:57 +0200 Subject: Define the `url_options` needed for SytemTest inside the route proxy: - I made a change in https://github.com/rails/rails/pull/36691 to delegate route helper to a proxy class. This didn't take into account that the `url_options` we redefine in SystemTest would be ignored. This PR fixes that by definin the url_options inside the proxy --- actionpack/lib/action_dispatch/system_test_case.rb | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'actionpack') diff --git a/actionpack/lib/action_dispatch/system_test_case.rb b/actionpack/lib/action_dispatch/system_test_case.rb index 9772beb8aa..4fda2cf44f 100644 --- a/actionpack/lib/action_dispatch/system_test_case.rb +++ b/actionpack/lib/action_dispatch/system_test_case.rb @@ -120,7 +120,13 @@ module ActionDispatch super self.class.driver.use @proxy_route = if ActionDispatch.test_app - Class.new { include ActionDispatch.test_app.routes.url_helpers }.new + Class.new do + include ActionDispatch.test_app.routes.url_helpers + + def url_options + default_url_options.merge(host: Capybara.app_host) + end + end.new else nil end @@ -164,10 +170,6 @@ module ActionDispatch driven_by :selenium - def url_options # :nodoc: - default_url_options.merge(host: Capybara.app_host) - end - def method_missing(method, *args, &block) if @proxy_route.respond_to?(method) @proxy_route.send(method, *args, &block) -- cgit v1.2.3