aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authoreileencodes <eileencodes@gmail.com>2016-11-06 18:55:15 -0500
committereileencodes <eileencodes@gmail.com>2017-02-20 15:07:33 -0500
commit5bf0aa6745db27c45c0778f9f6e9046f9ee9fb94 (patch)
tree7ba85a8ea15146725c68ce6b9e5a94ebac6d0c9c /actionpack/test
parenta21e18d5080a2c4808330271885f5664a725d3f3 (diff)
downloadrails-5bf0aa6745db27c45c0778f9f6e9046f9ee9fb94.tar.gz
rails-5bf0aa6745db27c45c0778f9f6e9046f9ee9fb94.tar.bz2
rails-5bf0aa6745db27c45c0778f9f6e9046f9ee9fb94.zip
Turn system testing into it's own gem and rename
Renames `Rails::SystemTestCase` to `ActionSystemTest` and moves it to a gem under the Rails name. We need to name the class `ActionSystemTestCase` because the gem expects a module but tests themselves expect a class. Adds MIT-LICENSE, CHANGELOG, and README for the future.
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/abstract_unit.rb1
-rw-r--r--actionpack/test/system_testing/capybara_driver_test.rb39
-rw-r--r--actionpack/test/system_testing/driver_adapter_test.rb13
-rw-r--r--actionpack/test/system_testing/rails_selenium_driver_test.rb58
-rw-r--r--actionpack/test/system_testing/screenshot_helper_test.rb20
5 files changed, 0 insertions, 131 deletions
diff --git a/actionpack/test/abstract_unit.rb b/actionpack/test/abstract_unit.rb
index 3b35af6d3a..459b0d6c54 100644
--- a/actionpack/test/abstract_unit.rb
+++ b/actionpack/test/abstract_unit.rb
@@ -33,7 +33,6 @@ require "action_view/testing/resolvers"
require "action_dispatch"
require "active_support/dependencies"
require "active_model"
-require "system_test_case"
require "pp" # require 'pp' early to prevent hidden_methods from not picking up the pretty-print methods until too late
diff --git a/actionpack/test/system_testing/capybara_driver_test.rb b/actionpack/test/system_testing/capybara_driver_test.rb
deleted file mode 100644
index 129fe95f25..0000000000
--- a/actionpack/test/system_testing/capybara_driver_test.rb
+++ /dev/null
@@ -1,39 +0,0 @@
-require "abstract_unit"
-
-class CapybaraDriverTest < ActiveSupport::TestCase
- 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(
- server: :webrick
- )
-
- 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
diff --git a/actionpack/test/system_testing/driver_adapter_test.rb b/actionpack/test/system_testing/driver_adapter_test.rb
deleted file mode 100644
index 035d018adf..0000000000
--- a/actionpack/test/system_testing/driver_adapter_test.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-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 = :rack_test
- end
- end
-end
diff --git a/actionpack/test/system_testing/rails_selenium_driver_test.rb b/actionpack/test/system_testing/rails_selenium_driver_test.rb
deleted file mode 100644
index 25fc6ca097..0000000000
--- a/actionpack/test/system_testing/rails_selenium_driver_test.rb
+++ /dev/null
@@ -1,58 +0,0 @@
-require "abstract_unit"
-
-class RailsSeleniumDriverTest < ActiveSupport::TestCase
- def setup
- Rails::SystemTestCase.driver = :rails_selenium_driver
- end
-
- def test_default_driver_adapter
- assert_kind_of SystemTesting::DriverAdapters::RailsSeleniumDriver, Rails::SystemTestCase.driver
- end
-
- def test_default_settings
- assert_equal :chrome, Rails::SystemTestCase.driver.browser
- assert_equal :puma, Rails::SystemTestCase.driver.server
- assert_equal 28100, Rails::SystemTestCase.driver.port
- assert_equal [1400,1400], Rails::SystemTestCase.driver.screen_size
- end
-
- def test_setting_browser
- Rails::SystemTestCase.driver = SystemTesting::DriverAdapters::RailsSeleniumDriver.new(
- browser: :firefox
- )
-
- assert_equal :firefox, Rails::SystemTestCase.driver.browser
- end
-
- def test_setting_server
- Rails::SystemTestCase.driver = SystemTesting::DriverAdapters::RailsSeleniumDriver.new(
- server: :webrick
- )
-
- assert_equal :webrick, Rails::SystemTestCase.driver.server
- end
-
- def test_setting_port
- Rails::SystemTestCase.driver = SystemTesting::DriverAdapters::RailsSeleniumDriver.new(
- port: 3000
- )
-
- assert_equal 3000, Rails::SystemTestCase.driver.port
- end
-
- def test_setting_screen_size
- Rails::SystemTestCase.driver = SystemTesting::DriverAdapters::RailsSeleniumDriver.new(
- screen_size: [ 800, 800 ]
- )
-
- assert_equal [ 800, 800 ], Rails::SystemTestCase.driver.screen_size
- end
-
- def test_does_not_accept_nonsense_kwargs
- assert_raises ArgumentError do
- Rails::SystemTestCase.driver = SystemTesting::DriverAdapters::RailsSeleniumDriver.new(
- made_up_arg: "x"
- )
- end
- end
-end
diff --git a/actionpack/test/system_testing/screenshot_helper_test.rb b/actionpack/test/system_testing/screenshot_helper_test.rb
deleted file mode 100644
index 8060c499df..0000000000
--- a/actionpack/test/system_testing/screenshot_helper_test.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-require "abstract_unit"
-
-class ScreenshotHelperTest < ActiveSupport::TestCase
- def test_driver_support_for_screenshots
- Rails::SystemTestCase.driver = :rails_selenium_driver
- assert Rails::SystemTestCase.driver.supports_screenshots?
-
- Rails::SystemTestCase.driver = :rack_test
- assert_not Rails::SystemTestCase.driver.supports_screenshots?
-
- Rails::SystemTestCase.driver = :selenium
- assert Rails::SystemTestCase.driver.supports_screenshots?
-
- Rails::SystemTestCase.driver = :webkit
- assert Rails::SystemTestCase.driver.supports_screenshots?
-
- Rails::SystemTestCase.driver = :poltergeist
- assert Rails::SystemTestCase.driver.supports_screenshots?
- end
-end