added case for missing parameter in delete_channel endpoint"
This commit is contained in:
parent
200602c698
commit
85f39a3586
@ -261,4 +261,17 @@ mod channels_tests {
|
|||||||
println!("Body: {:?}", resp.body());
|
println!("Body: {:?}", resp.body());
|
||||||
let _ = p.disconnect().await;
|
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());
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user