Skip to content

Commit f27f37e

Browse files
committed
Fix tests
1 parent bdbf55f commit f27f37e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,9 @@ mod tests {
100100
.write_all(b"[package]").unwrap();
101101
let mut req = test::MockRequest::new(Method::Get, "/Cargo.toml");
102102
let mut res = handler.call(&mut req).ok().expect("No response");
103-
let mut body = String::new();
104-
res.body.read_to_string(&mut body).unwrap();
105-
assert_eq!(body, "[package]");
103+
let mut body = Vec::new();
104+
res.body.write_body(&mut body).unwrap();
105+
assert_eq!(body, b"[package]");
106106
assert_eq!(res.headers.get("Content-Type"),
107107
Some(&vec!("text/plain".to_string())));
108108
assert_eq!(res.headers.get("Content-Length"),

0 commit comments

Comments
 (0)