From 4089181f72c6e9c96cceff4dd0905bcda208ec05 Mon Sep 17 00:00:00 2001 From: Dirkjan Ochtman Date: Tue, 21 Dec 2021 23:18:06 +0100 Subject: askama_rocket: revert to rocket 0.4 for release --- askama_rocket/tests/basic.rs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'askama_rocket/tests/basic.rs') diff --git a/askama_rocket/tests/basic.rs b/askama_rocket/tests/basic.rs index bfdb183..0671c4c 100644 --- a/askama_rocket/tests/basic.rs +++ b/askama_rocket/tests/basic.rs @@ -1,10 +1,12 @@ +#![feature(proc_macro_hygiene, decl_macro)] + #[macro_use] extern crate rocket; use askama::Template; use rocket::http::{ContentType, Status}; -use rocket::local::blocking::Client; +use rocket::local::Client; #[derive(Template)] #[template(path = "hello.html")] @@ -19,10 +21,10 @@ fn hello() -> HelloTemplate<'static> { #[test] fn test_rocket() { - let rocket = rocket::build().mount("/", routes![hello]); - let client = Client::tracked(rocket).unwrap(); - let rsp = client.get("/").dispatch(); + let rocket = rocket::ignite().mount("/", routes![hello]); + let client = Client::new(rocket).unwrap(); + let mut rsp = client.get("/").dispatch(); assert_eq!(rsp.status(), Status::Ok); assert_eq!(rsp.content_type(), Some(ContentType::HTML)); - assert_eq!(rsp.into_string().unwrap(), "Hello, world!"); + assert_eq!(rsp.body_string().unwrap(), "Hello, world!"); } -- cgit