aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/dispatch/static_test.rb2
-rw-r--r--actionpack/test/dispatch/system_testing/system_test_case_test.rb26
2 files changed, 15 insertions, 13 deletions
diff --git a/actionpack/test/dispatch/static_test.rb b/actionpack/test/dispatch/static_test.rb
index bd8318f5f6..3082d1072b 100644
--- a/actionpack/test/dispatch/static_test.rb
+++ b/actionpack/test/dispatch/static_test.rb
@@ -224,7 +224,7 @@ module StaticTests
def assert_gzip(file_name, response)
expected = File.read("#{FIXTURE_LOAD_PATH}/#{public_path}" + file_name)
- actual = Zlib::GzipReader.new(StringIO.new(response.body)).read
+ actual = ActiveSupport::Gzip.decompress(response.body)
assert_equal expected, actual
end
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