From 4c137dee0d21a8d5592e0dac04717be8ff53e552 Mon Sep 17 00:00:00 2001 From: Dave Date: Mon, 23 Feb 2026 23:24:25 +0000 Subject: [PATCH] story-kit: merge 99_story_test_coverage_http_health_rs_to_100 --- server/src/http/health.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/server/src/http/health.rs b/server/src/http/health.rs index d6c0cdc..8340ac1 100644 --- a/server/src/http/health.rs +++ b/server/src/http/health.rs @@ -39,6 +39,24 @@ impl HealthApi { mod tests { use super::*; + #[tokio::test] + async fn handler_health_returns_ok() { + let app = poem::Route::new().at("/health", poem::get(health)); + let cli = poem::test::TestClient::new(app); + let resp = cli.get("/health").send().await; + resp.assert_status_is_ok(); + resp.assert_text("ok").await; + } + + #[test] + fn health_status_serializes_to_json() { + let status = HealthStatus { + status: "ok".to_string(), + }; + let json = serde_json::to_value(&status).unwrap(); + assert_eq!(json["status"], "ok"); + } + #[tokio::test] async fn api_health_returns_ok_status() { let api = HealthApi;