class ActionDispatch::Integration::Session

def process(method, path, params: nil, headers: nil, env: nil, xhr: false, as: nil)

process :get, '/author', params: { since: 201501011400 }

Example:

response object.
object's @response instance variable will point to the same
called from an ActionDispatch::IntegrationTest object, then that
inspect the details of the response. Furthermore, if this method was
This method returns a Response object, which one can use to

request method that doesn't have a method defined in the integrations tests.
HTTP methods in integration tests. +#process+ is only required when using a
This method is rarely used directly. Use +#get+, +#post+, or other standard

merged into the Rack env hash.
- +env+: Additional env to pass, as a Hash. The headers will be
merged into the Rack env hash.
- +headers+: Additional headers to pass, as a Hash. The headers will be
multipart/form-data).
(application/x-www-form-urlencoded or
a Hash, or a String that is appropriately encoded
be +nil+,
- +params+: The HTTP parameters that you want to pass. This may
request.
- +path+: The URI (as a String) on which you want to perform the
as a symbol.
- +method+: The HTTP method (GET, POST, PATCH, PUT, DELETE, HEAD, OPTIONS)

Performs the actual request.
def process(method, path, params: nil, headers: nil, env: nil, xhr: false, as: nil)
  request_encoder = RequestEncoder.encoder(as)
  headers ||= {}
  if method == :get && as == :json && params
    headers['X-Http-Method-Override'] = 'GET'
    method = :post
  end
  if path =~ %r{://}
    location = URI.parse(path)
    https! URI::HTTPS === location if location.scheme
    if url_host = location.host
      default = Rack::Request::DEFAULT_PORTS[location.scheme]
      url_host += ":#{location.port}" if default != location.port
      host! url_host
    end
    path = location.query ? "#{location.path}?#{location.query}" : location.path
  end
  hostname, port = host.split(':')
  request_env = {
    :method => method,
    :params => request_encoder.encode_params(params),
    "SERVER_NAME"     => hostname,
    "SERVER_PORT"     => port || (https? ? "443" : "80"),
    "HTTPS"           => https? ? "on" : "off",
    "rack.url_scheme" => https? ? "https" : "http",
    "REQUEST_URI"    => path,
    "HTTP_HOST"      => host,
    "REMOTE_ADDR"    => remote_addr,
    "CONTENT_TYPE"   => request_encoder.content_type,
    "HTTP_ACCEPT"    => request_encoder.accept_header || accept
  }
  wrapped_headers = Http::Headers.from_hash({})
  wrapped_headers.merge!(headers) if headers
  if xhr
    wrapped_headers["HTTP_X_REQUESTED_WITH"] = "XMLHttpRequest"
    wrapped_headers["HTTP_ACCEPT"] ||= [Mime[:js], Mime[:html], Mime[:xml], "text/xml", "*/*"].join(", ")
  end
  # this modifies the passed request_env directly
  if wrapped_headers.present?
    Http::Headers.from_hash(request_env).merge!(wrapped_headers)
  end
  if env.present?
    Http::Headers.from_hash(request_env).merge!(env)
  end
  session = Rack::Test::Session.new(_mock_session)
  # NOTE: rack-test v0.5 doesn't build a default uri correctly
  # Make sure requested path is always a full uri
  session.request(build_full_uri(path, request_env), request_env)
  @request_count += 1
  @request = ActionDispatch::Request.new(session.last_request.env)
  response = _mock_session.last_response
  @response = ActionDispatch::TestResponse.from_response(response)
  @response.request = @request
  @html_document = nil
  @url_options = nil
  @controller = @request.controller_instance
  response.status
end