2024-04-22 17:00:55 -04:00
|
|
|
mod test_utils;
|
|
|
|
|
|
|
|
use test_utils::spawn_app;
|
|
|
|
|
2024-03-28 11:42:08 -04:00
|
|
|
#[tokio::test]
|
2024-04-22 17:00:55 -04:00
|
|
|
async fn health_check_works() {
|
2024-05-04 15:27:47 -04:00
|
|
|
let test_app = spawn_app().await;
|
2024-03-28 11:42:08 -04:00
|
|
|
|
|
|
|
let client = reqwest::Client::new();
|
|
|
|
|
2024-04-22 17:00:55 -04:00
|
|
|
let response = client
|
2024-05-04 15:27:47 -04:00
|
|
|
.get(&format!("{}/health_check", &test_app.address))
|
2024-04-22 17:00:55 -04:00
|
|
|
.send()
|
|
|
|
.await
|
|
|
|
.expect("Failed to execute health_check request.");
|
2024-03-28 11:42:08 -04:00
|
|
|
|
|
|
|
assert!(response.status().is_success());
|
|
|
|
assert_eq!(Some(0), response.content_length());
|
|
|
|
}
|