Integration test methods such as ActionDispatch::Integration::Session#get and ActionDispatch::Integration::Session#post return objects of class TestResponse, which represent the HTTP response results of the requested controller actions.

See Response for more information on controller response objects.

Methods
Included Modules
Public Class methods
from_response(response)
  # File actionpack/lib/action_dispatch/testing/test_response.rb, line 9
def self.from_response(response)
  new.tap do |resp|
    resp.status  = response.status
    resp.headers = response.headers
    resp.body    = response.body
  end
end
Public Instance methods
client_error?()

Was there a client client?

  # File actionpack/lib/action_dispatch/testing/test_response.rb, line 132
def client_error?
  (400..499).include?(response_code)
end
error?()

Was there a server-side error?

This method is also aliased as server_error?
  # File actionpack/lib/action_dispatch/testing/test_response.rb, line 126
def error?
  (500..599).include?(response_code)
end
missing?()

Was the URL not found?

  # File actionpack/lib/action_dispatch/testing/test_response.rb, line 116
def missing?
  response_code == 404
end
redirect?()

Were we redirected?

  # File actionpack/lib/action_dispatch/testing/test_response.rb, line 121
def redirect?
  (300..399).include?(response_code)
end
success?()

Was the response successful?

  # File actionpack/lib/action_dispatch/testing/test_response.rb, line 111
def success?
  (200..299).include?(response_code)
end