Included Modules

Class Index [+]

Quicksearch

ActionDispatch::TestResponse

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.

Public Class Methods

from_response(response) click to toggle source
    # File lib/action_dispatch/testing/test_response.rb, line 9
 9:     def self.from_response(response)
10:       new.tap do |resp|
11:         resp.status  = response.status
12:         resp.headers = response.headers
13:         resp.body    = response.body
14:       end
15:     end

Public Instance Methods

client_error?() click to toggle source

Was there a client client?

     # File lib/action_dispatch/testing/test_response.rb, line 132
132:     def client_error?
133:       (400..499).include?(response_code)
134:     end
error?() click to toggle source

Was there a server-side error?

     # File lib/action_dispatch/testing/test_response.rb, line 126
126:     def error?
127:       (500..599).include?(response_code)
128:     end
Also aliased as: server_error?
missing?() click to toggle source

Was the URL not found?

     # File lib/action_dispatch/testing/test_response.rb, line 116
116:     def missing?
117:       response_code == 404
118:     end
redirect?() click to toggle source

Were we redirected?

     # File lib/action_dispatch/testing/test_response.rb, line 121
121:     def redirect?
122:       (300..399).include?(response_code)
123:     end
server_error?() click to toggle source
Alias for: error?
success?() click to toggle source

Was the response successful?

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

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.