diff options
author | eileencodes <eileencodes@gmail.com> | 2016-10-02 17:37:57 -0400 |
---|---|---|
committer | eileencodes <eileencodes@gmail.com> | 2017-02-20 15:07:33 -0500 |
commit | c83e6d36dd13baa8b8cb48ce1c628788a2456d21 (patch) | |
tree | b7ff88d26cdea08b357cebf77e158547f1b84edd /actionpack/test | |
parent | e9127f7aa082986952ffcc8331b675a3a99c3a83 (diff) | |
download | rails-c83e6d36dd13baa8b8cb48ce1c628788a2456d21.tar.gz rails-c83e6d36dd13baa8b8cb48ce1c628788a2456d21.tar.bz2 rails-c83e6d36dd13baa8b8cb48ce1c628788a2456d21.zip |
Refactor so all drivers use Puma by default
Puma is the default webserver of Rails. Because of this it doesn't make
sense to run tests in Webkit if the default server is Puma.
Here I've refactored the webserver to be it's own standalone module so
it can be shared between Rails' selenium default driver and Capybara's
defaut drivers.
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/system_testing/capybara_driver_test.rb | 35 |
1 files changed, 32 insertions, 3 deletions
diff --git a/actionpack/test/system_testing/capybara_driver_test.rb b/actionpack/test/system_testing/capybara_driver_test.rb index b409fdfab0..a6be63ba7f 100644 --- a/actionpack/test/system_testing/capybara_driver_test.rb +++ b/actionpack/test/system_testing/capybara_driver_test.rb @@ -1,10 +1,39 @@ require 'abstract_unit' class CapybaraDriverTest < ActiveSupport::TestCase - def test_setting_useragent + def setup + Rails::SystemTestCase.driver = :poltergeist + end + + def test_default_driver_adapter + assert_kind_of SystemTesting::DriverAdapters::CapybaraDriver, Rails::SystemTestCase.driver + end + + def test_default_settings + assert_equal :poltergeist, Rails::SystemTestCase.driver.name + assert_equal :puma, Rails::SystemTestCase.driver.server + assert_equal 28100, Rails::SystemTestCase.driver.port + end + + def test_setting_driver + Rails::SystemTestCase.driver = :webkit + + assert_equal :webkit, Rails::SystemTestCase.driver.name + end + + def test_setting_server Rails::SystemTestCase.driver = SystemTesting::DriverAdapters::CapybaraDriver.new( - :rack_test + server: :webrick ) - assert_equal :rack_test, Rails::SystemTestCase.driver.name + + assert_equal :webrick, Rails::SystemTestCase.driver.server + end + + def test_setting_port + Rails::SystemTestCase.driver = SystemTesting::DriverAdapters::CapybaraDriver.new( + port: 3000 + ) + + assert_equal 3000, Rails::SystemTestCase.driver.port end end |