aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/dispatch/system_testing/driver_test.rb
diff options
context:
space:
mode:
authoreileencodes <eileencodes@gmail.com>2017-03-05 09:38:27 -0500
committereileencodes <eileencodes@gmail.com>2017-03-09 07:27:40 -0500
commit4dbebe487df54e8684183f3b3154639a77d8deaa (patch)
tree4eaa155dcdff8a5e15367e4f96781ccdce4a0f04 /actionpack/test/dispatch/system_testing/driver_test.rb
parent37770bc8d13c5c7af024e66539c79f966718aec0 (diff)
downloadrails-4dbebe487df54e8684183f3b3154639a77d8deaa.tar.gz
rails-4dbebe487df54e8684183f3b3154639a77d8deaa.tar.bz2
rails-4dbebe487df54e8684183f3b3154639a77d8deaa.zip
Refactor system test driver/browser
Since using a browser is only for selenium it doesn't really make sense to have a separate class for handling it there. This brings a lot of the if/else out of the main SystemTestCase class and into the Driver class so we can abstract away all that extra work.
Diffstat (limited to 'actionpack/test/dispatch/system_testing/driver_test.rb')
-rw-r--r--actionpack/test/dispatch/system_testing/driver_test.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/actionpack/test/dispatch/system_testing/driver_test.rb b/actionpack/test/dispatch/system_testing/driver_test.rb
index f0ebdb38db..96d598a7a3 100644
--- a/actionpack/test/dispatch/system_testing/driver_test.rb
+++ b/actionpack/test/dispatch/system_testing/driver_test.rb
@@ -6,4 +6,15 @@ class DriverTest < ActiveSupport::TestCase
driver = ActionDispatch::SystemTesting::Driver.new(:selenium)
assert_equal :selenium, driver.instance_variable_get(:@name)
end
+
+ test "initializing the driver with a browser" do
+ driver = ActionDispatch::SystemTesting::Driver.new(:selenium, using: :chrome, screen_size: [ 1400, 1400 ])
+ assert_equal :selenium, driver.instance_variable_get(:@name)
+ assert_equal :chrome, driver.instance_variable_get(:@using)
+ assert_equal [ 1400, 1400 ], driver.instance_variable_get(:@screen_size)
+ end
+
+ test "selenium? returns false if driver is poltergeist" do
+ assert_not ActionDispatch::SystemTesting::Driver.new(:poltergeist).send(:selenium?)
+ end
end