fix parse error when no status text. close #4

This commit is contained in:
Martin Algesten
2019-03-30 11:29:26 +01:00
parent 889988b4a3
commit d4d68ae585
2 changed files with 13 additions and 6 deletions

View File

@@ -138,3 +138,15 @@ fn non_ascii_header() {
assert_eq!(resp.status(), 500);
assert_eq!(resp.status_text(), "Bad Header");
}
#[test]
pub fn no_status_text() {
// this one doesn't return the status text
// let resp = get("https://www.okex.com/api/spot/v3/products")
test::set_handler("/no_status_text", |_unit| {
test::make_response(200, "", vec![], vec![])
});
let resp = get("test://host/no_status_text").call();
assert!(resp.ok());
assert_eq!(resp.status(), 200);
}