Skip to content

Commit

Permalink
Don't duplicate Rack::Response functionality. [#5320 state:resolved]
Browse files Browse the repository at this point in the history
Signed-off-by: José Valim <jose.valim@gmail.com>
  • Loading branch information
John Firebaugh authored and josevalim committed Sep 25, 2010
1 parent c509379 commit 308517e
Showing 1 changed file with 4 additions and 18 deletions.
22 changes: 4 additions & 18 deletions actionpack/lib/action_dispatch/testing/test_response.rb
Expand Up @@ -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

0 comments on commit 308517e

Please sign in to comment.