Methods
S
T
U
Instance Public methods
setup()
# File actionpack/test/dispatch/request_test.rb, line 4
def setup
  @env = {
    :ip_spoofing_check => true,
    "rack.input" => "foo"
  }
  @original_tld_length = ActionDispatch::Http::URL.tld_length
end
teardown()
# File actionpack/test/dispatch/request_test.rb, line 12
def teardown
  ActionDispatch::Http::URL.tld_length = @original_tld_length
end
url_for(options = {})
# File actionpack/test/dispatch/request_test.rb, line 16
def url_for(options = {})
  options = { host: 'www.example.com' }.merge!(options)
  ActionDispatch::Http::URL.url_for(options)
end
Instance Protected methods
stub_request(env = {})
# File actionpack/test/dispatch/request_test.rb, line 22
def stub_request(env = {})
  ip_spoofing_check = env.key?(:ip_spoofing_check) ? env.delete(:ip_spoofing_check) : true
  @trusted_proxies ||= nil
  ip_app = ActionDispatch::RemoteIp.new(Proc.new { }, ip_spoofing_check, @trusted_proxies)
  ActionDispatch::Http::URL.tld_length = env.delete(:tld_length) if env.key?(:tld_length)

  ip_app.call(env)

  env = @env.merge(env)
  ActionDispatch::Request.new(env)
end