diff --git a/crates/backend/tests/integration_tests.rs b/crates/backend/tests/integration_tests.rs index 43f5d53..e3431fe 100644 --- a/crates/backend/tests/integration_tests.rs +++ b/crates/backend/tests/integration_tests.rs @@ -10,32 +10,29 @@ mod tests { #[actix_web::test] async fn test_auth_with_transaction() { - with_transaction(|_tx| async { - let db = get_database().await; + let db = get_database().await; - let app = test::init_service( - App::new() - .app_data(web::Data::new(db.clone())) - .service(web::scope("/api/v1").configure(controller::register_controllers)), - ) + let app = test::init_service( + App::new() + .app_data(web::Data::new(db.clone())) + .service(web::scope("/api/v1").configure(controller::register_controllers)), + ) + .await; + + let resp = test::TestRequest::get() + .uri("/api/v1/ok") + .send_request(&app) .await; - let resp = test::TestRequest::get() - .uri("/api/v1/ok") - .send_request(&app) - .await; + let resp_status = resp.status(); - let resp_status = resp.status(); + let resp_body = test::read_body(resp).await; + let resp_body_str = String::from_utf8_lossy(&resp_body); + assert!( + resp_body_str.contains("available"), + "Expected 'available' in response body" + ); - let resp_body = test::read_body(resp).await; - let resp_body_str = String::from_utf8_lossy(&resp_body); - assert!( - resp_body_str.contains("available"), - "Expected 'available' in response body" - ); - - assert!(resp_status.is_success(), "Expected success response"); - }) - .await; + assert!(resp_status.is_success(), "Expected success response"); } }