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:
parent
b8e930aa01
commit
f245658495
1 changed files with 17 additions and 17 deletions
|
@ -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?
|
||||
|
|
Loading…
Reference in a new issue