1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Use Response status accessor instead of the Status header

This commit is contained in:
Joshua Peek 2008-08-17 19:13:49 -05:00
parent b8e930aa01
commit f245658495

View file

@ -160,16 +160,16 @@ module ActionController #:nodoc:
module TestResponseBehavior #:nodoc:
# The response code of the request
def response_code
headers['Status'][0,3].to_i rescue 0
status[0,3].to_i rescue 0
end
# Returns a String to ensure compatibility with Net::HTTPResponse
def code
headers['Status'].to_s.split(' ')[0]
status.to_s.split(' ')[0]
end
def message
headers['Status'].to_s.split(' ',2)[1]
status.to_s.split(' ',2)[1]
end
# Was the response successful?