Module: ActionDispatch::TestRequest

Defined in:
runtime/action_dispatch/request.rb,
runtime/action_dispatch/request.rbs

Overview

the Request a test builds by hand from a Rack env rather than from a transport. One per request shape, which is why it is not in the shared test harness: create maps the env keys the accessor-backed class below models and leaves the rest in the internal env hash, where headers reads them.

The class's initialize supplies what the env omits — "localhost", "/", GET — so a test that names only a host gets an otherwise ordinary request.

Class Method Summary collapse

Class Method Details

.create(env) ⇒ Object

NO DEFAULT on env: every caller names an env — a TestRequest with no env is a Request.new.



68
# File 'runtime/action_dispatch/request.rb', line 68

def self.create: (Hash[String, untyped] env) -> Request