Skip to main content

request_as

Function request_as 

Source
pub async fn request_as(
    router: &Router,
    method: Method,
    path: &str,
    bearer: &str,
    json: Option<&str>,
) -> TestResponse
Expand description

The same, carrying Authorization: Bearer <token>.

Every venture with a table whose access is not public-read needs this, and so does every admin-guarded route — and the kit did not have it, so three crates in this workspace each hand-rolled the same builder over tower::ServiceExt. A venture cannot: tower is not one of its dependencies, and telling an author to add one to test the routes the harness generated is telling them to work around the kit.

§Panics

Panics when the router itself fails (never for ordinary responses).