blob: c8895c1b187734ea6acf78739fb7bab377461bfa (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
use crate::harness::{TestServer, test_config};
#[tokio::test]
async fn health_endpoint_returns_200() {
let server = TestServer::start(test_config(tempfile::tempdir().unwrap().keep())).await;
let resp = TestServer::client()
.get(server.url("/health"))
.send()
.await
.expect("request failed");
assert_eq!(resp.status().as_u16(), 200);
let body = resp.text().await.expect("failed to read body");
let json: serde_json::Value = serde_json::from_str(&body).expect("invalid JSON");
assert_eq!(json["status"], "ok");
}
|