aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorEileen M. Uchitelle <eileencodes@users.noreply.github.com>2017-02-24 11:49:42 -0500
committerGitHub <noreply@github.com>2017-02-24 11:49:42 -0500
commit87b2b6c5124732ff709b8e1900a99ba0a08f6982 (patch)
tree74d84e1af6a375f59992a95c88801a54fe028bbb /actionpack/test
parentaa56dc235a341876762f0219738cac46d181fcd3 (diff)
parent704853b58be60b307261da9b9990a4c87c68860e (diff)
downloadrails-87b2b6c5124732ff709b8e1900a99ba0a08f6982.tar.gz
rails-87b2b6c5124732ff709b8e1900a99ba0a08f6982.tar.bz2
rails-87b2b6c5124732ff709b8e1900a99ba0a08f6982.zip
Merge pull request #28144 from lucasmazza/lm-system-test-driven-by
Change `SystemTestCase.driven_by` to use `setup`/`teardown` hooks
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/dispatch/system_testing/system_test_case_test.rb26
1 files changed, 14 insertions, 12 deletions
diff --git a/actionpack/test/dispatch/system_testing/system_test_case_test.rb b/actionpack/test/dispatch/system_testing/system_test_case_test.rb
index a384902a14..ff01d6739a 100644
--- a/actionpack/test/dispatch/system_testing/system_test_case_test.rb
+++ b/actionpack/test/dispatch/system_testing/system_test_case_test.rb
@@ -1,21 +1,23 @@
require "abstract_unit"
-class SystemTestCaseTest < ActiveSupport::TestCase
- test "driven_by sets Capybara's default driver to poltergeist" do
- ActionDispatch::SystemTestCase.driven_by :poltergeist
-
- assert_equal :poltergeist, Capybara.default_driver
+class DrivenByCaseTestTest < ActiveSupport::TestCase
+ test "selenium? returns false if driver is poltergeist" do
+ assert_not ActionDispatch::SystemTestCase.selenium?(:poltergeist)
end
+end
- test "driven_by sets Capybara's drivers respectively" do
- ActionDispatch::SystemTestCase.driven_by :selenium, using: :chrome
+class DrivenByRackTestTest < ActionDispatch::SystemTestCase
+ driven_by :rack_test
- assert_includes Capybara.drivers, :selenium
- assert_includes Capybara.drivers, :chrome
- assert_equal :chrome, Capybara.default_driver
+ test "uses rack_test" do
+ assert_equal :rack_test, Capybara.current_driver
end
+end
- test "selenium? returns false if driver is poltergeist" do
- assert_not ActionDispatch::SystemTestCase.selenium?(:poltergeist)
+class DrivenBySeleniumWithChromeTest < ActionDispatch::SystemTestCase
+ driven_by :selenium, using: :chrome
+
+ test "uses selenium" do
+ assert_equal :chrome, Capybara.current_driver
end
end