Using LocalResponse::into_json in async tests #1787
-
Hello again =) Are there any known issues with using let req = client.get("/exchange_rates?base=USD"e=EUR");
let res = req.dispatch().await;
assert_eq!(res.status(), Status::Ok);
let body = res.into_string().await.unwrap();
let body: ExchangeRate = json::from_str(&body).unwrap();
assert_eq!(rate, body);
let req = client.get("/exchange_rates?base=USD"e=EUR");
let res = req.dispatch().await;
assert_eq!(res.status(), Status::Ok);
// Time to halt forever...
let body = res.into_json::<ExchangeRate>().await.unwrap();
assert_eq!(rate, body); The first one has more boilerplate, so I tried to use Here is the full project, calling |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Yes. The issue has been fixed in master for some time and will be in the next release. |
Beta Was this translation helpful? Give feedback.
Yes. The issue has been fixed in master for some time and will be in the next release.