Fix test name and simplify helper
This commit is contained in:
@@ -87,7 +87,7 @@ mod tests {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[actix_rt::test]
|
#[actix_rt::test]
|
||||||
async fn test_login_reports_400_when_user_does_not_exist() {
|
async fn test_login_reports_404_when_user_does_not_exist() {
|
||||||
let dao = TestUserDao::new();
|
let dao = TestUserDao::new();
|
||||||
dao.create_user("user", "password");
|
dao.create_user("user", "password");
|
||||||
|
|
||||||
|
|||||||
@@ -175,10 +175,7 @@ pub mod testhelpers {
|
|||||||
impl BodyReader for ResponseBody<Body> {
|
impl BodyReader for ResponseBody<Body> {
|
||||||
fn read_to_str(&self) -> &str {
|
fn read_to_str(&self) -> &str {
|
||||||
match self {
|
match self {
|
||||||
ResponseBody::Body(body) => match body {
|
ResponseBody::Body(Body::Bytes(ref b)) => std::str::from_utf8(b).unwrap(),
|
||||||
Body::Bytes(b) => std::str::from_utf8(&b).unwrap(),
|
|
||||||
_ => panic!("Unknown response body content"),
|
|
||||||
},
|
|
||||||
_ => panic!("Unknown response body"),
|
_ => panic!("Unknown response body"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user