test: convert single test file to test suite

This commit is contained in:
Sandro Eiler 2024-03-02 22:01:31 +01:00
parent b61f02c03f
commit da1a508616
5 changed files with 199 additions and 194 deletions

19
tests/api/health_check.rs Normal file
View file

@ -0,0 +1,19 @@
use crate::helpers::{spawn_app, TestApp};
#[tokio::test]
async fn health_check_works() {
// Arrange
let TestApp { address, .. } = spawn_app().await;
// Act
let client = reqwest::Client::new();
let response = client
.get(format!("{address}/health_check"))
.send()
.await
.expect("Failed to execute request.");
// Assert
assert!(response.status().is_success());
assert_eq!(Some(0), response.content_length());
}