mirror of
https://github.com/kristoferssolo/kristofersxyz-rs.git
synced 2025-10-21 20:10:36 +00:00
fix: tests
This commit is contained in:
parent
8f60a5d385
commit
44f586a369
@ -4,7 +4,7 @@ use reqwest::Client;
|
||||
#[tokio::test]
|
||||
async fn health_check() {
|
||||
let app = spawn_app().await;
|
||||
let url = format!("{}/health_check", &app.addr);
|
||||
let url = format!("http://{}/api/v1/health_check", &app.addr);
|
||||
let client = Client::new();
|
||||
let response = client
|
||||
.get(&url)
|
||||
|
||||
@ -21,6 +21,7 @@ static TRACING: Lazy<()> = Lazy::new(|| {
|
||||
}
|
||||
});
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct TestApp {
|
||||
pub _pool: PgPool,
|
||||
pub addr: SocketAddr,
|
||||
@ -46,7 +47,7 @@ pub async fn spawn_app() -> TestApp {
|
||||
.expect("Failed to build application.");
|
||||
let addr = application.addr();
|
||||
|
||||
let _ = tokio::spawn(application.start()).await;
|
||||
tokio::spawn(application.start());
|
||||
|
||||
TestApp {
|
||||
_pool: get_connection_pool(&config.database),
|
||||
|
||||
Loading…
Reference in New Issue
Block a user