Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Don't duplicate Rack::Response functionality. [#5320 state:resolved]

Signed-off-by: José Valim <jose.valim@gmail.com>
  • Loading branch information...
commit 308517e913ef1e8d9f13e023bc450374b5ed780a 1 parent c509379
John Firebaugh authored josevalim committed
Showing with 4 additions and 18 deletions.
  1. +4 −18 actionpack/lib/action_dispatch/testing/test_response.rb
View
22 actionpack/lib/action_dispatch/testing/test_response.rb
@@ -15,29 +15,15 @@ def self.from_response(response)
end
# Was the response successful?
- def success?
- (200..299).include?(response_code)
- end
+ alias_method :success?, :successful?
# Was the URL not found?
- def missing?
- response_code == 404
- end
+ alias_method :missing?, :not_found?
# Were we redirected?
- def redirect?
- (300..399).include?(response_code)
- end
+ alias_method :redirect?, :redirection?
# Was there a server-side error?
- def error?
- (500..599).include?(response_code)
- end
- alias_method :server_error?, :error?
-
- # Was there a client client?
- def client_error?
- (400..499).include?(response_code)
- end
+ alias_method :error?, :server_error?
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.