aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/system_testing
diff options
context:
space:
mode:
authoryalab <rudeboyjet@gmail.com>2017-06-29 14:06:27 +0900
committeryalab <rudeboyjet@gmail.com>2017-07-01 23:29:55 +0900
commit1aea1ddd2a4b3bfa7bb556e4c7cd40f9531ac2e3 (patch)
tree2a24f03b6e3ded4a928b6d142f424aa7e78aac77 /actionpack/lib/action_dispatch/system_testing
parent1e798ccb8ff83cc5a014d333e7a1e92e5d146c23 (diff)
downloadrails-1aea1ddd2a4b3bfa7bb556e4c7cd40f9531ac2e3.tar.gz
rails-1aea1ddd2a4b3bfa7bb556e4c7cd40f9531ac2e3.tar.bz2
rails-1aea1ddd2a4b3bfa7bb556e4c7cd40f9531ac2e3.zip
SystemTestCase undef some IntegrationTest methods because it's confused to use.
Diffstat (limited to 'actionpack/lib/action_dispatch/system_testing')
-rw-r--r--actionpack/lib/action_dispatch/system_testing/test_helpers/undef_methods.rb24
1 files changed, 24 insertions, 0 deletions
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
new file mode 100644
index 0000000000..2d3f4662d7
--- /dev/null
+++ b/actionpack/lib/action_dispatch/system_testing/test_helpers/undef_methods.rb
@@ -0,0 +1,24 @@
+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
+ else
+ super
+ end
+ end
+ end
+ end
+ end
+ end
+end