radiant/testing

Test request builders and assertions.

Types

A composable request used by router tests.

pub opaque type TestRequest

Values

pub fn build(
  test_request: TestRequest,
) -> request.Request(BitArray)
pub fn request(
  method: http.Method,
  raw_path: String,
) -> TestRequest
pub fn should_have_body(
  resp: response.Response(BitArray),
  expected: String,
) -> response.Response(BitArray)
pub fn should_have_header(
  resp: response.Response(BitArray),
  name: String,
  expected: String,
) -> response.Response(BitArray)
pub fn should_have_json_body(
  resp: response.Response(BitArray),
  decoder: decode.Decoder(a),
) -> a
pub fn should_have_status(
  resp: response.Response(BitArray),
  expected: Int,
) -> response.Response(BitArray)
pub fn test_delete(raw_path: String) -> request.Request(BitArray)
pub fn test_get(raw_path: String) -> request.Request(BitArray)
pub fn test_head(raw_path: String) -> request.Request(BitArray)
pub fn test_options(
  raw_path: String,
) -> request.Request(BitArray)
pub fn test_patch(
  raw_path: String,
  body_text: String,
) -> request.Request(BitArray)
pub fn test_post(
  raw_path: String,
  body_text: String,
) -> request.Request(BitArray)
pub fn test_put(
  raw_path: String,
  body_text: String,
) -> request.Request(BitArray)
pub fn test_request(
  method: http.Method,
  raw_path: String,
) -> request.Request(BitArray)
pub fn with_query(
  test_request: TestRequest,
  key: String,
  value: String,
) -> TestRequest
pub fn with_request_body(
  test_request: TestRequest,
  body: String,
) -> TestRequest
pub fn with_request_header(
  test_request: TestRequest,
  key: String,
  value: String,
) -> TestRequest
Search Document