diff options
author | Shritesh Bhattarai <shritesh@shritesh.com> | 2021-06-15 09:45:19 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-15 15:45:19 +0200 |
commit | b318d7cbcded2c6dfc66bbe19687f1246a9a9eab (patch) | |
tree | af453e71287c9fdc8530526609b3c3c4bf3c32fa /askama_rocket/tests | |
parent | 25eae265a2d14a33a1723bfa0c5dc7a7f6b5a6ab (diff) | |
download | askama-b318d7cbcded2c6dfc66bbe19687f1246a9a9eab.tar.gz askama-b318d7cbcded2c6dfc66bbe19687f1246a9a9eab.tar.bz2 askama-b318d7cbcded2c6dfc66bbe19687f1246a9a9eab.zip |
Support rocket 0.5.0-rc.1 based on @flo-l's PR (#495)
See #412 for earlier iteration.
Diffstat (limited to '')
-rw-r--r-- | askama_rocket/tests/basic.rs | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/askama_rocket/tests/basic.rs b/askama_rocket/tests/basic.rs index 0671c4c..bfdb183 100644 --- a/askama_rocket/tests/basic.rs +++ b/askama_rocket/tests/basic.rs @@ -1,12 +1,10 @@ -#![feature(proc_macro_hygiene, decl_macro)] - #[macro_use] extern crate rocket; use askama::Template; use rocket::http::{ContentType, Status}; -use rocket::local::Client; +use rocket::local::blocking::Client; #[derive(Template)] #[template(path = "hello.html")] @@ -21,10 +19,10 @@ fn hello() -> HelloTemplate<'static> { #[test] fn test_rocket() { - let rocket = rocket::ignite().mount("/", routes![hello]); - let client = Client::new(rocket).unwrap(); - let mut rsp = client.get("/").dispatch(); + let rocket = rocket::build().mount("/", routes![hello]); + let client = Client::tracked(rocket).unwrap(); + let rsp = client.get("/").dispatch(); assert_eq!(rsp.status(), Status::Ok); assert_eq!(rsp.content_type(), Some(ContentType::HTML)); - assert_eq!(rsp.body_string().unwrap(), "Hello, world!"); + assert_eq!(rsp.into_string().unwrap(), "Hello, world!"); } |