diff options
author | George Claghorn <george@basecamp.com> | 2019-05-16 09:02:36 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-16 09:02:36 -0400 |
commit | c8396e030f4b1edd48340975696dcaf6aa8291c9 (patch) | |
tree | 6246c1d3f8ac1c8212b613cc3ced8885c9fcc382 /actionpack/lib/action_dispatch/system_test_case.rb | |
parent | 9c87d2316adf36cf33b1b7afe8d779bf420c52a7 (diff) | |
download | rails-c8396e030f4b1edd48340975696dcaf6aa8291c9.tar.gz rails-c8396e030f4b1edd48340975696dcaf6aa8291c9.tar.bz2 rails-c8396e030f4b1edd48340975696dcaf6aa8291c9.zip |
Permit running jobs in system tests
Inherit from ActiveSupport::TestCase instead of ActionDispatch::IntegrationTest. Active Job automatically mixes its test helper into the latter, forcibly setting the test queue adapter before Capybara starts its app server.
As a bonus, we no longer need to remove the parts of the ActionDispatch::IntegrationTest API we don’t want to expose.
Diffstat (limited to 'actionpack/lib/action_dispatch/system_test_case.rb')
-rw-r--r-- | actionpack/lib/action_dispatch/system_test_case.rb | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/actionpack/lib/action_dispatch/system_test_case.rb b/actionpack/lib/action_dispatch/system_test_case.rb index 066daa4a12..a7fb5fa330 100644 --- a/actionpack/lib/action_dispatch/system_test_case.rb +++ b/actionpack/lib/action_dispatch/system_test_case.rb @@ -10,7 +10,6 @@ require "action_dispatch/system_testing/browser" require "action_dispatch/system_testing/server" require "action_dispatch/system_testing/test_helpers/screenshot_helper" require "action_dispatch/system_testing/test_helpers/setup_and_teardown" -require "action_dispatch/system_testing/test_helpers/undef_methods" module ActionDispatch # = System Testing @@ -110,12 +109,11 @@ module ActionDispatch # Because <tt>ActionDispatch::SystemTestCase</tt> is a shim between Capybara # and Rails, any driver that is supported by Capybara is supported by system # tests as long as you include the required gems and files. - class SystemTestCase < IntegrationTest + class SystemTestCase < ActiveSupport::TestCase include Capybara::DSL include Capybara::Minitest::Assertions include SystemTesting::TestHelpers::SetupAndTeardown include SystemTesting::TestHelpers::ScreenshotHelper - include SystemTesting::TestHelpers::UndefMethods def initialize(*) # :nodoc: super @@ -160,6 +158,10 @@ module ActionDispatch driven_by :selenium + def url_options # :nodoc: + default_url_options.merge(host: Capybara.app_host) + end + ActiveSupport.run_load_hooks(:action_dispatch_system_test_case, self) end |