edge badge
Methods
A
C
H
I
N
P
R
U
Constants
DEFAULT_ENV = Rack::MockRequest.env_for('/', 'HTTP_HOST' => 'test.host', 'REMOTE_ADDR' => '0.0.0.0', 'HTTP_USER_AGENT' => 'Rails Testing' )
 
Class Public methods
new(env = {})
# File actionpack/lib/action_dispatch/testing/test_request.rb, line 12
def self.new(env = {})
  super
end
new(env = {})
# File actionpack/lib/action_dispatch/testing/test_request.rb, line 16
def initialize(env = {})
  env = Rails.application.env_config.merge(env) if defined?(Rails.application) && Rails.application
  super(default_env.merge(env))
end
Instance Public methods
accept=(mime_types)
# File actionpack/lib/action_dispatch/testing/test_request.rb, line 61
def accept=(mime_types)
  @env.delete('action_dispatch.request.accepts')
  @env['HTTP_ACCEPT'] = Array(mime_types).collect(&:to_s).join(",")
end
action=(action_name)
# File actionpack/lib/action_dispatch/testing/test_request.rb, line 41
def action=(action_name)
  path_parameters[:action] = action_name.to_s
end
cookies()
Also aliased as: rack_cookies
# File actionpack/lib/action_dispatch/testing/test_request.rb, line 68
def cookies
  @cookies ||= {}.with_indifferent_access
end
host=(host)
# File actionpack/lib/action_dispatch/testing/test_request.rb, line 25
def host=(host)
  @env['HTTP_HOST'] = host
end
if_modified_since=(last_modified)
# File actionpack/lib/action_dispatch/testing/test_request.rb, line 45
def if_modified_since=(last_modified)
  @env['HTTP_IF_MODIFIED_SINCE'] = last_modified
end
if_none_match=(etag)
# File actionpack/lib/action_dispatch/testing/test_request.rb, line 49
def if_none_match=(etag)
  @env['HTTP_IF_NONE_MATCH'] = etag
end
path=(path)
# File actionpack/lib/action_dispatch/testing/test_request.rb, line 37
def path=(path)
  @env['PATH_INFO'] = path
end
port=(number)
# File actionpack/lib/action_dispatch/testing/test_request.rb, line 29
def port=(number)
  @env['SERVER_PORT'] = number.to_i
end
rack_cookies()
Alias for: cookies
remote_addr=(addr)
# File actionpack/lib/action_dispatch/testing/test_request.rb, line 53
def remote_addr=(addr)
  @env['REMOTE_ADDR'] = addr
end
request_method=(method)
# File actionpack/lib/action_dispatch/testing/test_request.rb, line 21
def request_method=(method)
  @env['REQUEST_METHOD'] = method.to_s.upcase
end
request_uri=(uri)
# File actionpack/lib/action_dispatch/testing/test_request.rb, line 33
def request_uri=(uri)
  @env['REQUEST_URI'] = uri
end
user_agent=(user_agent)
# File actionpack/lib/action_dispatch/testing/test_request.rb, line 57
def user_agent=(user_agent)
  @env['HTTP_USER_AGENT'] = user_agent
end