Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SystemTestCase undef some IntegrationTest methods because it's confus…
…ed to use.
- Loading branch information
Showing
3 changed files
with
58 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
actionpack/lib/action_dispatch/system_testing/test_helpers/undef_methods.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters