feat: add user profile management with update and retrieval endpoints, enhance database setup for testing

This commit is contained in:
2025-09-06 14:24:27 +02:00
parent 6e63dca513
commit c9e99e6f23
21 changed files with 422 additions and 42 deletions

View File

@@ -13,16 +13,24 @@ pub struct TestApp {
}
pub async fn setup() -> TestApp {
std::env::set_var("DATABASE_URL", "sqlite::memory:");
std::env::set_var(
"MANAGEMENT_DATABASE_URL",
"postgres://postgres:postgres@localhost:5434/postgres",
);
std::env::set_var(
"DATABASE_URL",
"postgres://postgres:postgres@localhost:5434/postgres",
);
std::env::set_var("AUTH_SECRET", "test_secret");
std::env::set_var("BASE_URL", "http://localhost:3000");
std::env::set_var("HOST", "localhost");
std::env::set_var("PORT", "3000");
std::env::set_var("LOG_LEVEL", "debug");
let db = setup_test_db("sqlite::memory:")
.await
.expect("Failed to set up test db");
let db = setup_test_db().await.expect("Failed to set up test db");
let db = db.clone();
let router = setup_router(db.clone(), &app::config::Config::from_env());
TestApp { router, db }
}