diff options
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/system_testing/base.rb | 2 | ||||
-rw-r--r-- | actionpack/lib/system_testing/driver_adapter.rb | 6 | ||||
-rw-r--r-- | actionpack/lib/system_testing/railtie.rb | 14 |
3 files changed, 18 insertions, 4 deletions
diff --git a/actionpack/lib/system_testing/base.rb b/actionpack/lib/system_testing/base.rb index ae4236f97d..770342da82 100644 --- a/actionpack/lib/system_testing/base.rb +++ b/actionpack/lib/system_testing/base.rb @@ -5,5 +5,7 @@ module SystemTesting module Base include TestHelper include DriverAdapter + + ActiveSupport.run_load_hooks(:system_testing, self) end end diff --git a/actionpack/lib/system_testing/driver_adapter.rb b/actionpack/lib/system_testing/driver_adapter.rb index 70c4396323..6d94582395 100644 --- a/actionpack/lib/system_testing/driver_adapter.rb +++ b/actionpack/lib/system_testing/driver_adapter.rb @@ -4,11 +4,9 @@ module SystemTesting module DriverAdapter extend ActiveSupport::Concern - included do - self.driver_adapter = :capybara_rack_test_driver - end - module ClassMethods + attr_accessor :driver_adapter + def driver_adapter=(driver_name_or_class) driver = DriverAdapters.lookup(driver_name_or_class).new driver.call diff --git a/actionpack/lib/system_testing/railtie.rb b/actionpack/lib/system_testing/railtie.rb new file mode 100644 index 0000000000..aa3df29344 --- /dev/null +++ b/actionpack/lib/system_testing/railtie.rb @@ -0,0 +1,14 @@ +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_adapter ||= :capybara_rack_test_driver + + ActiveSupport.on_load(:system_testing) do + options.each { |k,v| send("#{k}=", v) } + end + end + end +end |