feat: add user profile management with update and retrieval endpoints, enhance database setup for testing
This commit is contained in:
@@ -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 }
|
||||
}
|
||||
|
Reference in New Issue
Block a user