aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/system_testing/driver_adapter_test.rb
diff options
context:
space:
mode:
authoreileencodes <eileencodes@gmail.com>2016-08-27 16:48:24 -0400
committereileencodes <eileencodes@gmail.com>2017-02-20 15:07:32 -0500
commit9730b1dba6d1bb9684a54915ac3735d9c0eade26 (patch)
treec2e74e65c3b333254a512338b04d8ef5fdcfe6bc /actionpack/test/system_testing/driver_adapter_test.rb
parent4533bb7dcbdd6e0451395bc869d6c3603c6ff1df (diff)
downloadrails-9730b1dba6d1bb9684a54915ac3735d9c0eade26.tar.gz
rails-9730b1dba6d1bb9684a54915ac3735d9c0eade26.tar.bz2
rails-9730b1dba6d1bb9684a54915ac3735d9c0eade26.zip
Add tests for system testing
* Adds test case test * Adds driver adapter test * Adds tests for capybara seleium driver (testing the settings not actually opening the browser to test capybara w/ selenium because that would so so so slow) * Adds tests for rack test driver * Adds tests for generators
Diffstat (limited to 'actionpack/test/system_testing/driver_adapter_test.rb')
-rw-r--r--actionpack/test/system_testing/driver_adapter_test.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/actionpack/test/system_testing/driver_adapter_test.rb b/actionpack/test/system_testing/driver_adapter_test.rb
new file mode 100644
index 0000000000..bfbeaa63a2
--- /dev/null
+++ b/actionpack/test/system_testing/driver_adapter_test.rb
@@ -0,0 +1,19 @@
+require 'abstract_unit'
+
+class DriverAdapterTest < ActiveSupport::TestCase
+ test 'only registered adapters are accepted' do
+ assert_raises(NameError) do
+ Rails::SystemTestCase.driver = :whatever
+ end
+
+ assert_nothing_raised do
+ Rails::SystemTestCase.driver = :capybara_selenium_driver
+ end
+ end
+
+ test 'settings can only be used for the appropriate adapter' do
+ assert_raises(ArgumentError) do
+ Rails::SystemTestCase.driver = SystemTesting::DriverAdapters::CapybaraRackTestDriver.new(something: 'test')
+ end
+ end
+end