From 308517e913ef1e8d9f13e023bc450374b5ed780a Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Fri, 6 Aug 2010 11:24:09 -0700 Subject: [PATCH] Don't duplicate Rack::Response functionality. [#5320 state:resolved] MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: José Valim --- .../action_dispatch/testing/test_response.rb | 22 ++++--------------- 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/actionpack/lib/action_dispatch/testing/test_response.rb b/actionpack/lib/action_dispatch/testing/test_response.rb index 926034762ff0f..82039e72e7cfc 100644 --- a/actionpack/lib/action_dispatch/testing/test_response.rb +++ b/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