diff options
author | eileencodes <eileencodes@gmail.com> | 2016-10-01 11:17:43 -0400 |
---|---|---|
committer | eileencodes <eileencodes@gmail.com> | 2017-02-20 15:07:33 -0500 |
commit | f482eddbeff9fe3d0dc6cdaa9a4b53df839f667c (patch) | |
tree | d9b70ef78d4e1ee3e67430dd6e7cfc8e5a2bec4d /actionpack/lib/system_testing/driver_adapter.rb | |
parent | b44320254167152383b1fa8792cb17847a51fb49 (diff) | |
download | rails-f482eddbeff9fe3d0dc6cdaa9a4b53df839f667c.tar.gz rails-f482eddbeff9fe3d0dc6cdaa9a4b53df839f667c.tar.bz2 rails-f482eddbeff9fe3d0dc6cdaa9a4b53df839f667c.zip |
Reconfigure how the drivers work
This removes the useless Rack Test Driver that Rails was providing and
moves to a shim like approach for default adapters.
If someone wants to use one of the default Capybara Drivers then we will
initialize a new `CapybaraDriver` that simply sets the default driver.
Rails though is much more opinionated than Capybara and to make system
testing a "works out of the box" framework in Rails we have the
`RailsSeleniumDriver`. This driver sets defaults that Rails deems
important for selenium testing. The purpose of this is to simply add a
test and it just works.
Diffstat (limited to 'actionpack/lib/system_testing/driver_adapter.rb')
-rw-r--r-- | actionpack/lib/system_testing/driver_adapter.rb | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/actionpack/lib/system_testing/driver_adapter.rb b/actionpack/lib/system_testing/driver_adapter.rb index cf44a4fd6b..3d8545f3c6 100644 --- a/actionpack/lib/system_testing/driver_adapter.rb +++ b/actionpack/lib/system_testing/driver_adapter.rb @@ -4,32 +4,26 @@ module SystemTesting # The <tt>SystemTesting::DriverAdapter</tt> module is used to load the driver # set in your Rails' test configuration file. # - # The default driver adapters is the +:capybara_rack_test_driver+. + # The default driver adapter is the +:rails_selenium_driver+. module DriverAdapter extend ActiveSupport::Concern module ClassMethods def default_driver # :nodoc - :capybara_rack_test_driver + :rails_selenium_driver end # Returns the current driver that is set. If no driver is set in the - # Rails' configuration file then +:capybara_rack_test_driver+ will be + # Rails' configuration file then +:rails_selenium_driver+ will be # initialized. def driver - @driver ||= DriverAdapters.lookup(default_driver).new + @driver ||= DriverAdapters.lookup(default_driver) end # Specify the adapter and settings for the system test driver set in the # Rails' configuration file. - def driver=(adapter) - @driver = case adapter - when Symbol - DriverAdapters.lookup(adapter).new - else - adapter - end - + def driver=(driver) + @driver = DriverAdapters.lookup(driver) @driver.call end end |