added case for missing parameter in delete_channel endpoint"

This commit is contained in:
shockrah 2020-08-20 20:51:03 -07:00
parent 200602c698
commit 85f39a3586

View File

@ -261,4 +261,17 @@ mod channels_tests {
println!("Body: {:?}", resp.body());
let _ = p.disconnect().await;
}
#[tokio::test]
async fn delete_channel_missing_name() {
let p = get_pool();
let mut resp = hyper_resp();
// this endpoint is super lenient for some reason btw
let param: Value = serde_json::from_str("{}").expect("JSON is not written correctly");
super::delete_channel(&p, &mut resp, param).await;
assert_eq!(StatusCode::BAD_REQUEST, resp.status());
}
}