tests/testthat/_snaps/redirector.md

make_redirect_handler validates target parameters

Code
  make_redirect_handler(list(keys = c("id"), n_wildcard = 0), c("user_id"),
  "/profiles/:user_id", 307L)
Condition
  Error:
  ! `to` cannot contain path parameters not present in `from`

Redirector validation checks input types

Code
  redirector$redirect_temporary("INVALID", "/old", "/new")
Condition
  Error in `redirector$redirect_temporary()`:
  ! `method` must be one of "get", "head", "post", "put", "delete", "connect", "options", "trace", "patch", or "all", not "invalid".
Code
  redirector$redirect_temporary("get", 123, "/new")
Condition
  Error in `redirector$redirect_temporary()`:
  ! `from` must be a single string, not the number 123.
Code
  redirector$redirect_temporary("get", "/old", 123)
Condition
  Error in `redirector$redirect_temporary()`:
  ! `to` must be a single string, not the number 123.


Try the routr package in your browser

Any scripts or data that you put into this service are public.

routr documentation built on Aug. 21, 2025, 5:47 p.m.