mirror of https://github.com/rwf2/Rocket.git
Adjust spacing in handlebars_templates example.
This commit is contained in:
parent
99a17b42ae
commit
725191d3c3
|
@ -22,11 +22,9 @@ fn test_root() {
|
||||||
let mut req = MockRequest::new(*method, "/");
|
let mut req = MockRequest::new(*method, "/");
|
||||||
run_test!(req, |mut response: Response| {
|
run_test!(req, |mut response: Response| {
|
||||||
assert_eq!(response.status(), Status::SeeOther);
|
assert_eq!(response.status(), Status::SeeOther);
|
||||||
|
|
||||||
assert!(response.body().is_none());
|
assert!(response.body().is_none());
|
||||||
|
|
||||||
let location_headers: Vec<_> = response.header_values("Location").collect();
|
let location_headers: Vec<_> = response.header_values("Location").collect();
|
||||||
|
|
||||||
assert_eq!(location_headers, vec!["/hello/Unknown"]);
|
assert_eq!(location_headers, vec!["/hello/Unknown"]);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -58,8 +56,8 @@ fn test_name() {
|
||||||
name: "Jack".to_string(),
|
name: "Jack".to_string(),
|
||||||
items: vec!["One", "Two", "Three"].iter().map(|s| s.to_string()).collect()
|
items: vec!["One", "Two", "Three"].iter().map(|s| s.to_string()).collect()
|
||||||
};
|
};
|
||||||
let expected = Template::render("index", &context).to_string();
|
|
||||||
|
|
||||||
|
let expected = Template::render("index", &context).to_string();
|
||||||
let body_string = response.body().and_then(|body| body.into_string());
|
let body_string = response.body().and_then(|body| body.into_string());
|
||||||
assert_eq!(body_string, Some(expected));
|
assert_eq!(body_string, Some(expected));
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue