diff --git a/src/main.rs b/src/main.rs index 63a0e79..dcf1074 100644 --- a/src/main.rs +++ b/src/main.rs @@ -97,7 +97,7 @@ mod tests { .expect("Failed to create pool"); db::migrations(&pool).await; - let mut tx = pool.begin().await.unwrap(); + let tx = pool.begin().await.unwrap(); let app = init::routes().await.layer(axum::Extension(pool)); let usr = icarus_auth::models::common::CreateUser { @@ -105,46 +105,21 @@ mod tests { password: String::from("Raindown!"), }; - /* - let client = reqwest::Client::new(); - let url = icarus_auth::callers::endpoints::REGISTER; - let response = app.oneshot( - println!("Errr") - ) - .await.unwrap(); - */ - - /* - match client.post(url).json(&usr).send().await { - Ok(response) => {} - Err(err) => { - assert!(false, "Error: {:?}", err.to_string()); - } - } - */ - let payload = json!({ "username": usr.username, "password": usr.password, }); - assert!(true, "Info: {:?}", payload); - println!("Info: {:?}", payload); - let response = app .oneshot( Request::builder() .method(axum::http::Method::POST) .uri(callers::endpoints::REGISTER) .header(axum::http::header::CONTENT_TYPE, "application/json") - // .body(Body::new(axum::Json(usr))) - // .body(Body::empty()) .body(Body::from(payload.to_string())) - // .body(Body::from("{\"username\": \"sssss\",\"theanswer\"}")) .unwrap(), ) .await; - // .unwrap(); match response { Ok(resp) => {