File tree Expand file tree Collapse file tree 2 files changed +7
-9
lines changed
lib/action_dispatch/system_testing
test/dispatch/system_testing Expand file tree Collapse file tree 2 files changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -5,13 +5,13 @@ module SystemTesting
5
5
class Driver # :nodoc:
6
6
def initialize ( name , **options , &capabilities )
7
7
@name = name
8
- @browser = Browser . new ( options [ :using ] )
9
8
@screen_size = options [ :screen_size ]
10
9
@options = options [ :options ] || { }
11
10
@capabilities = capabilities
12
11
13
12
if name == :selenium
14
13
require "selenium/webdriver"
14
+ @browser = Browser . new ( options [ :using ] )
15
15
@browser . preload
16
16
end
17
17
end
@@ -28,7 +28,7 @@ def registerable?
28
28
end
29
29
30
30
def register
31
- @browser . configure ( &@capabilities )
31
+ @browser & .configure ( &@capabilities )
32
32
33
33
Capybara . register_driver @name do |app |
34
34
case @name
Original file line number Diff line number Diff line change @@ -148,13 +148,11 @@ class DriverTest < ActiveSupport::TestCase
148
148
::Selenium ::WebDriver ::Chrome ::Service . driver_path = original_driver_path
149
149
end
150
150
151
- test "does not preload if used driver is not :selenium" do
152
- assert_not_called_on_instance_of ( ActionDispatch ::SystemTesting ::Browser , :preload ) do
153
- ActionDispatch ::SystemTesting ::Driver . new ( :rack_test , using : :chrome )
154
- end
151
+ test "does not configure browser if driver is not :selenium" do
152
+ # sanity check
153
+ assert ActionDispatch ::SystemTesting ::Driver . new ( :selenium ) . instance_variable_get ( :@browser )
155
154
156
- assert_not_called_on_instance_of ( ActionDispatch ::SystemTesting ::Browser , :preload ) do
157
- ActionDispatch ::SystemTesting ::Driver . new ( :poltergeist )
158
- end
155
+ assert_nil ActionDispatch ::SystemTesting ::Driver . new ( :rack_test ) . instance_variable_get ( :@browser )
156
+ assert_nil ActionDispatch ::SystemTesting ::Driver . new ( :poltergeist ) . instance_variable_get ( :@browser )
159
157
end
160
158
end
You can’t perform that action at this time.
0 commit comments