blob: 69a5f234451d2b2504172a396163d9c9711c315d (
plain) (
tree)
|
|
use askama::Template;
use warp::Filter;
#[derive(Template)]
#[template(path = "hello.html")]
struct HelloTemplate<'a> {
name: &'a str,
}
#[tokio::test]
async fn test_warp() {
let filter = warp::get().map(|| HelloTemplate { name: "world" });
let res = warp::test::request().reply(&filter).await;
assert_eq!(res.status(), 200);
assert_eq!(res.body(), "Hello, world!");
}
|