aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/system_testing
diff options
context:
space:
mode:
authorGeorge Claghorn <george@basecamp.com>2019-05-16 09:02:36 -0400
committerGitHub <noreply@github.com>2019-05-16 09:02:36 -0400
commitc8396e030f4b1edd48340975696dcaf6aa8291c9 (patch)
tree6246c1d3f8ac1c8212b613cc3ced8885c9fcc382 /actionpack/lib/action_dispatch/system_testing
parent9c87d2316adf36cf33b1b7afe8d779bf420c52a7 (diff)
downloadrails-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_testing')
-rw-r--r--actionpack/lib/action_dispatch/system_testing/test_helpers/setup_and_teardown.rb1
-rw-r--r--actionpack/lib/action_dispatch/system_testing/test_helpers/undef_methods.rb26
2 files changed, 0 insertions, 27 deletions
diff --git a/actionpack/lib/action_dispatch/system_testing/test_helpers/setup_and_teardown.rb b/actionpack/lib/action_dispatch/system_testing/test_helpers/setup_and_teardown.rb
index 7080dbe022..20f6a7634f 100644
--- a/actionpack/lib/action_dispatch/system_testing/test_helpers/setup_and_teardown.rb
+++ b/actionpack/lib/action_dispatch/system_testing/test_helpers/setup_and_teardown.rb
@@ -7,7 +7,6 @@ module ActionDispatch
DEFAULT_HOST = "http://127.0.0.1"
def host!(host)
- super
Capybara.app_host = host
end
diff --git a/actionpack/lib/action_dispatch/system_testing/test_helpers/undef_methods.rb b/actionpack/lib/action_dispatch/system_testing/test_helpers/undef_methods.rb
deleted file mode 100644
index d64be3b3d9..0000000000
--- a/actionpack/lib/action_dispatch/system_testing/test_helpers/undef_methods.rb
+++ /dev/null
@@ -1,26 +0,0 @@
-# frozen_string_literal: true
-
-module ActionDispatch
- module SystemTesting
- module TestHelpers
- module UndefMethods # :nodoc:
- extend ActiveSupport::Concern
- included do
- METHODS = %i(get post put patch delete).freeze
-
- METHODS.each do |verb|
- undef_method verb
- end
-
- def method_missing(method, *args, &block)
- if METHODS.include?(method)
- raise NoMethodError, "System tests cannot make direct requests via ##{method}; use #visit and #click_on instead. See http://www.rubydoc.info/github/teamcapybara/capybara/master#The_DSL for more information."
- else
- super
- end
- end
- end
- end
- end
- end
-end