aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/system_test_case.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib/action_dispatch/system_test_case.rb')
-rw-r--r--actionpack/lib/action_dispatch/system_test_case.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/actionpack/lib/action_dispatch/system_test_case.rb b/actionpack/lib/action_dispatch/system_test_case.rb
index a7fb5fa330..9772beb8aa 100644
--- a/actionpack/lib/action_dispatch/system_test_case.rb
+++ b/actionpack/lib/action_dispatch/system_test_case.rb
@@ -4,6 +4,7 @@ gem "capybara", ">= 2.15"
require "capybara/dsl"
require "capybara/minitest"
+require "selenium/webdriver"
require "action_controller"
require "action_dispatch/system_testing/driver"
require "action_dispatch/system_testing/browser"
@@ -118,6 +119,11 @@ module ActionDispatch
def initialize(*) # :nodoc:
super
self.class.driver.use
+ @proxy_route = if ActionDispatch.test_app
+ Class.new { include ActionDispatch.test_app.routes.url_helpers }.new
+ else
+ nil
+ end
end
def self.start_application # :nodoc:
@@ -162,6 +168,14 @@ module ActionDispatch
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)
+ else
+ super
+ end
+ end
+
ActiveSupport.run_load_hooks(:action_dispatch_system_test_case, self)
end