Skip to content

Commit 0c820da

Browse files
committed
test: full health check
1 parent 7480917 commit 0c820da

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

tests/db/health_check.rs

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use maedic::database::MaedicHealth;
33
use crate::helpers::spawn_app;
44

55
#[tokio::test]
6-
async fn health_check_works() {
6+
async fn test_self_health_works() {
77
let app = spawn_app().await;
88
let client = reqwest::Client::new();
99

@@ -19,7 +19,7 @@ async fn health_check_works() {
1919
}
2020

2121
#[tokio::test]
22-
async fn config_endpoint_works() {
22+
async fn test_config_endpoint_works() {
2323
let app = spawn_app().await;
2424
let client = reqwest::Client::new();
2525

@@ -31,3 +31,17 @@ async fn config_endpoint_works() {
3131

3232
assert!(response.status().is_success());
3333
}
34+
35+
#[tokio::test]
36+
async fn test_pw_health_endpoint_works_with_db() {
37+
let app = spawn_app().await;
38+
let client = reqwest::Client::new();
39+
40+
let response = client
41+
.get(format!("{}/v1/health", app.address))
42+
.send()
43+
.await
44+
.expect("Failed to execute request");
45+
46+
assert!(response.status().is_success());
47+
}

0 commit comments

Comments
 (0)