added endpoint test for channel deletion based on non existant cname

This commit is contained in:
shockrah 2020-08-20 20:53:24 -07:00
parent 85f39a3586
commit 80112b8c59

View File

@ -274,4 +274,17 @@ mod channels_tests {
assert_eq!(StatusCode::BAD_REQUEST, resp.status());
}
#[tokio::test]
async fn delet_channel_non_real_channel() {
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(r#"{
"name": "this channel doesn't exist"
}"#).expect("JSON is not written correctly");
super::delete_channel(&p, &mut resp, param).await;
assert_eq!(StatusCode::OK, resp.status());
}
}