Test refactor
Rust Build / Test Suite (pull_request) Successful in 1m20s
Rust Build / Rustfmt (pull_request) Successful in 32s
Rust Build / Check (pull_request) Successful in 1m42s
Rust Build / Clippy (pull_request) Successful in 1m22s
Rust Build / build (pull_request) Successful in 1m55s
Rust Build / Test Suite (pull_request) Successful in 1m20s
Rust Build / Rustfmt (pull_request) Successful in 32s
Rust Build / Check (pull_request) Successful in 1m42s
Rust Build / Clippy (pull_request) Successful in 1m22s
Rust Build / build (pull_request) Successful in 1m55s
This commit is contained in:
+2
-17
@@ -193,23 +193,8 @@ async fn test_register_user() {
|
|||||||
|
|
||||||
let app = init::routes().await.layer(axum::Extension(pool));
|
let app = init::routes().await.layer(axum::Extension(pool));
|
||||||
|
|
||||||
match requests::register_user(&app).await {
|
match register_user(&app).await {
|
||||||
Ok(response) => {
|
Ok(returned_user) => {
|
||||||
assert_eq!(
|
|
||||||
axum::http::StatusCode::CREATED,
|
|
||||||
response.status(),
|
|
||||||
"Status does not match {:?}",
|
|
||||||
response.status()
|
|
||||||
);
|
|
||||||
let body = axum::body::to_bytes(response.into_body(), usize::MAX)
|
|
||||||
.await
|
|
||||||
.unwrap();
|
|
||||||
let parsed_body: callers::register::response::Response =
|
|
||||||
serde_json::from_slice(&body).unwrap();
|
|
||||||
assert!(parsed_body.data.len() > 0, "No data returned");
|
|
||||||
|
|
||||||
let returned_user = &parsed_body.data[0];
|
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
TEST_USERNAME, returned_user.username,
|
TEST_USERNAME, returned_user.username,
|
||||||
"Error with returned user"
|
"Error with returned user"
|
||||||
|
|||||||
Reference in New Issue
Block a user