test: convert single test file to test suite
This commit is contained in:
parent
b61f02c03f
commit
da1a508616
5 changed files with 199 additions and 194 deletions
19
tests/api/health_check.rs
Normal file
19
tests/api/health_check.rs
Normal 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());
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue