diff options
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/system_testing/capybara_driver_test.rb | 10 | ||||
-rw-r--r-- | actionpack/test/system_testing/capybara_rack_test_driver_test.rb | 26 | ||||
-rw-r--r-- | actionpack/test/system_testing/driver_adapter_test.rb | 8 | ||||
-rw-r--r-- | actionpack/test/system_testing/rails_selenium_driver_test.rb (renamed from actionpack/test/system_testing/capybara_selenium_driver_test.rb) | 18 |
4 files changed, 20 insertions, 42 deletions
diff --git a/actionpack/test/system_testing/capybara_driver_test.rb b/actionpack/test/system_testing/capybara_driver_test.rb new file mode 100644 index 0000000000..b409fdfab0 --- /dev/null +++ b/actionpack/test/system_testing/capybara_driver_test.rb @@ -0,0 +1,10 @@ +require 'abstract_unit' + +class CapybaraDriverTest < ActiveSupport::TestCase + def test_setting_useragent + Rails::SystemTestCase.driver = SystemTesting::DriverAdapters::CapybaraDriver.new( + :rack_test + ) + assert_equal :rack_test, Rails::SystemTestCase.driver.name + end +end diff --git a/actionpack/test/system_testing/capybara_rack_test_driver_test.rb b/actionpack/test/system_testing/capybara_rack_test_driver_test.rb deleted file mode 100644 index 0f037760d3..0000000000 --- a/actionpack/test/system_testing/capybara_rack_test_driver_test.rb +++ /dev/null @@ -1,26 +0,0 @@ -require 'abstract_unit' - -class CapybaraRackTestDriverTest < ActiveSupport::TestCase - def test_default_driver_adapter - assert_kind_of SystemTesting::DriverAdapters::CapybaraRackTestDriver, Rails::SystemTestCase.driver - end - - def test_default_settings - assert_equal 'Capybara', Rails::SystemTestCase.driver.useragent - end - - def test_setting_useragent - Rails::SystemTestCase.driver = SystemTesting::DriverAdapters::CapybaraRackTestDriver.new( - useragent: 'x' - ) - assert_equal 'x', Rails::SystemTestCase.driver.useragent - end - - def test_does_not_accept_nonsense_kwargs - assert_raises ArgumentError do - Rails::SystemTestCase.driver = SystemTesting::DriverAdapters::CapybaraRackTestDriver.new( - made_up_arg: 'x' - ) - end - end -end diff --git a/actionpack/test/system_testing/driver_adapter_test.rb b/actionpack/test/system_testing/driver_adapter_test.rb index bfbeaa63a2..220a755bd3 100644 --- a/actionpack/test/system_testing/driver_adapter_test.rb +++ b/actionpack/test/system_testing/driver_adapter_test.rb @@ -7,13 +7,7 @@ class DriverAdapterTest < ActiveSupport::TestCase 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') + Rails::SystemTestCase.driver = :rack_test end end end diff --git a/actionpack/test/system_testing/capybara_selenium_driver_test.rb b/actionpack/test/system_testing/rails_selenium_driver_test.rb index 6357b35aa6..c239444838 100644 --- a/actionpack/test/system_testing/capybara_selenium_driver_test.rb +++ b/actionpack/test/system_testing/rails_selenium_driver_test.rb @@ -1,12 +1,12 @@ require 'abstract_unit' -class CapybaraSeleniumDriverTest < ActiveSupport::TestCase +class RailsSeleniumDriverTest < ActiveSupport::TestCase def setup - Rails::SystemTestCase.driver = :capybara_selenium_driver + Rails::SystemTestCase.driver = :rails_selenium_driver end - def test_setting_driver_adapter_to_selenium - assert_kind_of SystemTesting::DriverAdapters::CapybaraSeleniumDriver, Rails::SystemTestCase.driver + def test_default_driver_adapter + assert_kind_of SystemTesting::DriverAdapters::RailsSeleniumDriver, Rails::SystemTestCase.driver end def test_default_settings @@ -17,7 +17,7 @@ class CapybaraSeleniumDriverTest < ActiveSupport::TestCase end def test_setting_browser - Rails::SystemTestCase.driver = SystemTesting::DriverAdapters::CapybaraSeleniumDriver.new( + Rails::SystemTestCase.driver = SystemTesting::DriverAdapters::RailsSeleniumDriver.new( browser: :firefox ) @@ -25,7 +25,7 @@ class CapybaraSeleniumDriverTest < ActiveSupport::TestCase end def test_setting_server - Rails::SystemTestCase.driver = SystemTesting::DriverAdapters::CapybaraSeleniumDriver.new( + Rails::SystemTestCase.driver = SystemTesting::DriverAdapters::RailsSeleniumDriver.new( server: :webrick ) @@ -33,7 +33,7 @@ class CapybaraSeleniumDriverTest < ActiveSupport::TestCase end def test_setting_port - Rails::SystemTestCase.driver = SystemTesting::DriverAdapters::CapybaraSeleniumDriver.new( + Rails::SystemTestCase.driver = SystemTesting::DriverAdapters::RailsSeleniumDriver.new( port: 3000 ) @@ -41,7 +41,7 @@ class CapybaraSeleniumDriverTest < ActiveSupport::TestCase end def test_setting_screen_size - Rails::SystemTestCase.driver = SystemTesting::DriverAdapters::CapybaraSeleniumDriver.new( + Rails::SystemTestCase.driver = SystemTesting::DriverAdapters::RailsSeleniumDriver.new( screen_size: [ 800, 800 ] ) @@ -50,7 +50,7 @@ class CapybaraSeleniumDriverTest < ActiveSupport::TestCase def test_does_not_accept_nonsense_kwargs assert_raises ArgumentError do - Rails::SystemTestCase.driver = SystemTesting::DriverAdapters::CapybaraSeleniumDriver.new( + Rails::SystemTestCase.driver = SystemTesting::DriverAdapters::RailsSeleniumDriver.new( made_up_arg: 'x' ) end |