diff options
author | Eileen M. Uchitelle <eileencodes@users.noreply.github.com> | 2017-03-29 07:53:10 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-29 07:53:10 -0400 |
commit | 56f3af4a6b130bd9ebb86c97a34fcc5135793f70 (patch) | |
tree | 81ce9cb65a3c7c0fc01c664ec57efae64c6f113b /actionpack/lib | |
parent | c8832cea49ad7228e5fc09c8867aec2c3c970d49 (diff) | |
parent | 24e0fa7c4ab81f6c2fb2b3af90ee217620f30d17 (diff) | |
download | rails-56f3af4a6b130bd9ebb86c97a34fcc5135793f70.tar.gz rails-56f3af4a6b130bd9ebb86c97a34fcc5135793f70.tar.bz2 rails-56f3af4a6b130bd9ebb86c97a34fcc5135793f70.zip |
Merge pull request #28586 from mtsmfm/override-driver
Make `driven_by` overridable
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_dispatch/system_test_case.rb | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/actionpack/lib/action_dispatch/system_test_case.rb b/actionpack/lib/action_dispatch/system_test_case.rb index 9cc3d0757f..98fdb36c91 100644 --- a/actionpack/lib/action_dispatch/system_test_case.rb +++ b/actionpack/lib/action_dispatch/system_test_case.rb @@ -87,7 +87,7 @@ module ActionDispatch def initialize(*) # :nodoc: super - self.class.superclass.driver.use + self.class.driver.use end def self.start_application # :nodoc: @@ -100,6 +100,8 @@ module ActionDispatch SystemTesting::Server.new.run end + class_attribute :driver, instance_accessor: false + # System Test configuration options # # The default settings are Selenium, using Chrome, with a screen size @@ -113,13 +115,10 @@ module ActionDispatch # # driven_by :selenium, screen_size: [800, 800] def self.driven_by(driver, using: :chrome, screen_size: [1400, 1400], options: {}) - @driver = SystemTesting::Driver.new(driver, using: using, screen_size: screen_size, options: options) + self.driver = SystemTesting::Driver.new(driver, using: using, screen_size: screen_size, options: options) end - # Returns the driver object for the initialized system test - def self.driver - @driver ||= SystemTestCase.driven_by(:selenium) - end + driven_by :selenium end SystemTestCase.start_application |