aboutsummaryrefslogtreecommitdiffstats
path: root/askama_rocket
diff options
context:
space:
mode:
Diffstat (limited to 'askama_rocket')
-rw-r--r--askama_rocket/Cargo.toml4
-rw-r--r--askama_rocket/src/lib.rs2
-rw-r--r--askama_rocket/tests/basic.rs12
3 files changed, 8 insertions, 10 deletions
diff --git a/askama_rocket/Cargo.toml b/askama_rocket/Cargo.toml
index bc91cfb..4c87ba0 100644
--- a/askama_rocket/Cargo.toml
+++ b/askama_rocket/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "askama_rocket"
-version = "0.10.0"
+version = "0.11.0-rc.1"
authors = ["Dirkjan Ochtman <dirkjan@ochtman.nl>"]
description = "Rocket integration for Askama templates"
documentation = "https://docs.rs/askama"
@@ -15,4 +15,4 @@ edition = "2018"
[dependencies]
askama = { version = "0.10", path = "../askama", default-features = false, features = ["with-rocket", "mime", "mime_guess"] }
-rocket = { version = "0.4", default-features = false }
+rocket = { version = "0.5.0-rc.1", default-features = false }
diff --git a/askama_rocket/src/lib.rs b/askama_rocket/src/lib.rs
index 6db3b7b..ee70965 100644
--- a/askama_rocket/src/lib.rs
+++ b/askama_rocket/src/lib.rs
@@ -11,6 +11,6 @@ pub fn respond<T: Template>(t: &T, ext: &str) -> Result<'static> {
let ctype = ContentType::from_extension(ext).ok_or(Status::InternalServerError)?;
Response::build()
.header(ctype)
- .sized_body(Cursor::new(rsp))
+ .sized_body(rsp.len(), Cursor::new(rsp))
.ok()
}
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!");
}