well **** me now its fixed
This commit is contained in:
parent
6e66e89a2e
commit
1472572e3d
1 changed files with 19 additions and 22 deletions
|
@ -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");
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue