email_newsletter_api/tests/health_check.rs
minhtrannhat 5e6e9c2efe
feat(test): spin up new logical database tests
- Tests will use new database every run
- Added chrono and uuid dependencies.
- Updated documentation
2024-05-04 15:27:47 -04:00

20 lines
451 B
Rust

mod test_utils;
use test_utils::spawn_app;
#[tokio::test]
async fn health_check_works() {
let test_app = spawn_app().await;
let client = reqwest::Client::new();
let response = client
.get(&format!("{}/health_check", &test_app.address))
.send()
.await
.expect("Failed to execute health_check request.");
assert!(response.status().is_success());
assert_eq!(Some(0), response.content_length());
}