aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/lib/system_testing/driver_adapter.rb11
-rw-r--r--actionpack/lib/system_testing/railtie.rb4
-rw-r--r--actionpack/lib/system_testing/test_helper.rb5
3 files changed, 12 insertions, 8 deletions
diff --git a/actionpack/lib/system_testing/driver_adapter.rb b/actionpack/lib/system_testing/driver_adapter.rb
index 3958fa4559..47d37a26b7 100644
--- a/actionpack/lib/system_testing/driver_adapter.rb
+++ b/actionpack/lib/system_testing/driver_adapter.rb
@@ -13,8 +13,15 @@ module SystemTesting
@driver ||= DriverAdapters.lookup(default_driver).new
end
- def driver=(adapter: default_driver, settings: {})
- @driver = DriverAdapters.lookup(adapter).new(settings)
+ def driver=(adapter)
+ @driver = case adapter
+ when Symbol
+ DriverAdapters.lookup(adapter).new
+ else
+ adapter
+ end
+
+ @driver.call
end
end
end
diff --git a/actionpack/lib/system_testing/railtie.rb b/actionpack/lib/system_testing/railtie.rb
index f77184ad3d..6c1ddf1448 100644
--- a/actionpack/lib/system_testing/railtie.rb
+++ b/actionpack/lib/system_testing/railtie.rb
@@ -1,10 +1,12 @@
+require 'system_test_case'
+
module SystemTesting
class Railtie < Rails::Railtie
config.system_testing = ActiveSupport::OrderedOptions.new
initializer "system_testing.set_configs" do |app|
options = app.config.system_testing
- options.driver ||= {}
+ options.driver ||= Rails::SystemTestCase.default_driver
ActiveSupport.on_load(:system_testing) do
options.each { |k,v| send("#{k}=", v) }
diff --git a/actionpack/lib/system_testing/test_helper.rb b/actionpack/lib/system_testing/test_helper.rb
index bbf4e469ac..9f2778919c 100644
--- a/actionpack/lib/system_testing/test_helper.rb
+++ b/actionpack/lib/system_testing/test_helper.rb
@@ -13,11 +13,6 @@ module SystemTesting
end
end
- def before_setup
- Base.driver.call
- super
- end
-
def after_teardown
Capybara.reset_sessions!
super