Whitelist-API/API/tests/routes/health_check.rs
2023-11-27 12:29:47 -06:00

19 lines
455 B
Rust

use crate::helpers::TestApp;
#[sqlx::test]
async fn health_check_works(pool: sqlx::PgPool) {
let app = TestApp::spawn(&pool).await;
// Act
let response = app
.client
.get(String::from(&app.address) + "/health")
.send()
.await
.expect("Failed to execute request.");
// Check
assert_eq!(response.status(), reqwest::StatusCode::NO_CONTENT);
assert_eq!(Some(0), response.content_length());
}