diff options
Diffstat (limited to 'actionpack/lib/action_dispatch/system_testing/test_helpers')
-rw-r--r-- | actionpack/lib/action_dispatch/system_testing/test_helpers/setup_and_teardown.rb | 12 | ||||
-rw-r--r-- | actionpack/lib/action_dispatch/system_testing/test_helpers/undef_methods.rb | 26 |
2 files changed, 4 insertions, 34 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..30dc21ebb9 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 @@ -4,16 +4,12 @@ module ActionDispatch module SystemTesting module TestHelpers module SetupAndTeardown # :nodoc: - DEFAULT_HOST = "http://127.0.0.1" - def host!(host) - super - Capybara.app_host = host - end + ActiveSupport::Deprecation.warn \ + "ActionDispatch::SystemTestCase#host! is deprecated with no replacement. " \ + "Set Capybara.app_host directly or rely on Capybara's default host." - def before_setup - host! DEFAULT_HOST - super + Capybara.app_host = host end def before_teardown 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 |