move list_all_channels_to equivalent rust code
This commit is contained in:
@@ -201,3 +201,25 @@ pub async fn delete_channel(pool: &Pool, response: &mut Response<Body>, params:
|
||||
*response.status_mut() = StatusCode::BAD_REQUEST;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#[cfg(test)]
|
||||
mod channels_tests {
|
||||
use crate::testing::{get_pool, hyper_resp};
|
||||
use hyper::StatusCode;
|
||||
|
||||
#[tokio::test]
|
||||
async fn list_all_channels_good() {
|
||||
// Generation of data
|
||||
let p = get_pool();
|
||||
let mut resp = hyper_resp();
|
||||
// @params: none
|
||||
// Collection of data
|
||||
super::list_channels(&p, &mut resp).await;
|
||||
|
||||
// Analysis
|
||||
assert_eq!(StatusCode::OK, resp.status());
|
||||
println!("list_all_channels_good : \t{:?}", resp.body());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user