aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib
diff options
context:
space:
mode:
authorTrevor Wistaff <trev@a07.com.au>2017-08-07 13:35:11 +1000
committerTrevor Wistaff <trev@a07.com.au>2017-08-07 13:48:02 +1000
commitaf3500b18817a48d7ec83812a0d4869f3fe33b2f (patch)
tree0624352a23b8c10ae83e9caf4119005fbdc2a43b /actionpack/lib
parentdf94b863c2ff8f1bcf12e36ed8fc1419292668e7 (diff)
downloadrails-af3500b18817a48d7ec83812a0d4869f3fe33b2f.tar.gz
rails-af3500b18817a48d7ec83812a0d4869f3fe33b2f.tar.bz2
rails-af3500b18817a48d7ec83812a0d4869f3fe33b2f.zip
Deprecate ActionDispatch::TestResponse response aliases
https://github.com/rails/rails/issues/30072
Diffstat (limited to 'actionpack/lib')
-rw-r--r--actionpack/lib/action_dispatch/testing/test_response.rb24
1 files changed, 21 insertions, 3 deletions
diff --git a/actionpack/lib/action_dispatch/testing/test_response.rb b/actionpack/lib/action_dispatch/testing/test_response.rb
index 0b7e9ca945..b23ea7479c 100644
--- a/actionpack/lib/action_dispatch/testing/test_response.rb
+++ b/actionpack/lib/action_dispatch/testing/test_response.rb
@@ -20,13 +20,31 @@ module ActionDispatch
end
# Was the response successful?
- alias_method :success?, :successful?
+ def success?
+ ActiveSupport::Deprecation.warn(<<-MSG.squish)
+ The success? predicate is deprecated and will be removed in Rails 6.0.
+ Please use successful? as provided by Rack::Response::Helpers.
+ MSG
+ successful?
+ end
# Was the URL not found?
- alias_method :missing?, :not_found?
+ def missing?
+ ActiveSupport::Deprecation.warn(<<-MSG.squish)
+ The missing? predicate is deprecated and will be removed in Rails 6.0.
+ Please use not_found? as provided by Rack::Response::Helpers.
+ MSG
+ not_found?
+ end
# Was there a server-side error?
- alias_method :error?, :server_error?
+ def error?
+ ActiveSupport::Deprecation.warn(<<-MSG.squish)
+ The error? predicate is deprecated and will be removed in Rails 6.0.
+ Please use server_error? as provided by Rack::Response::Helpers.
+ MSG
+ server_error?
+ end
def parsed_body
@parsed_body ||= @response_parser.call(body)