Macro trillium_testing::prelude::assert_status

source ·
macro_rules! assert_status {
    ($conn:expr, $status:expr) => { ... };
}
Expand description

assert that the status code of a conn is as specified.

use trillium_testing::prelude::*;
async fn handler(conn: trillium::Conn) -> trillium::Conn {
    conn.with_status(418)
}


assert_status!(get("/").on(&handler), 418);
assert_status!(get("/").on(&handler), Status::ImATeapot);

let conn = get("/").on(&handler);
assert_status!(&conn, 418);
assert_status!(conn, 418);
use trillium_testing::prelude::*;
async fn handler(conn: trillium::Conn) -> trillium::Conn {
    conn.ok("handled")
}

assert_status!(get("/").on(&handler), 418);