aboutsummaryrefslogtreecommitdiffstats
path: root/askama_rocket/tests/basic.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--askama_rocket/tests/basic.rs12
1 files changed, 7 insertions, 5 deletions
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!");
}