email_newsletter_api/tests/health_check.rs

20 lines
451 B
Rust
Raw Normal View History

mod test_utils;
use test_utils::spawn_app;
2024-03-28 11:42:08 -04:00
#[tokio::test]
async fn health_check_works() {
let test_app = spawn_app().await;
2024-03-28 11:42:08 -04:00
let client = reqwest::Client::new();
let response = client
.get(&format!("{}/health_check", &test_app.address))
.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());
}