aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/system_testing
diff options
context:
space:
mode:
authoreileencodes <eileencodes@gmail.com>2017-07-08 11:08:03 -0400
committereileencodes <eileencodes@gmail.com>2017-07-08 11:13:28 -0400
commit91d22b783275474464a03f6487f5c28b5dc803b3 (patch)
tree797cf240a7532af1c439c903db1e47e2d855e230 /actionpack/lib/action_dispatch/system_testing
parenta136c291ed29953787e8218137c01eadf6da63a8 (diff)
downloadrails-91d22b783275474464a03f6487f5c28b5dc803b3.tar.gz
rails-91d22b783275474464a03f6487f5c28b5dc803b3.tar.bz2
rails-91d22b783275474464a03f6487f5c28b5dc803b3.zip
Don't call register on custom drivers
It's possible for developers toadd a custom driver and then call it using `driven_by`. Because we were only skipping `register` for `:rack_test` that meant any custom driver would attempt to be registered as well. The three listed here are special because Rails registers them with special options. If you're registering your own custom driver then you don't want to separately register that driver. Fixes #29688
Diffstat (limited to 'actionpack/lib/action_dispatch/system_testing')
-rw-r--r--actionpack/lib/action_dispatch/system_testing/driver.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/actionpack/lib/action_dispatch/system_testing/driver.rb b/actionpack/lib/action_dispatch/system_testing/driver.rb
index 1a027f2e23..81e6f0fc80 100644
--- a/actionpack/lib/action_dispatch/system_testing/driver.rb
+++ b/actionpack/lib/action_dispatch/system_testing/driver.rb
@@ -9,14 +9,14 @@ module ActionDispatch
end
def use
- register unless rack_test?
+ register if registerable?
setup
end
private
- def rack_test?
- @name == :rack_test
+ def registerable?
+ [:selenium, :poltergeist, :webkit].include?(@name)
end
def register