Goal
Add integration tests for the auth handlers (signup, signin, change_password, status) in api/src/users.rs using in-memory SQLite.
File to edit
api/src/users.rs
Setup helper
#[cfg(test)]
mod tests {
use super::*;
use axum::{extract::State, Json};
use axum_extra::extract::cookie::CookieJar;
use sqlx::SqlitePool;
async fn setup_db() -> SqlitePool {
let pool = SqlitePool::connect("sqlite::memory:").await.unwrap();
sqlx::migrate!("../migrations").run(&pool).await.unwrap();
pool
}
fn app_state(pool: SqlitePool) -> crate::AppState {
crate::AppState { db: pool, client: None, bucket: None }
}
}
How to run
cd api && cargo test users
Sub-issues (pick one)
Goal
Add integration tests for the auth handlers (signup, signin, change_password, status) in
api/src/users.rsusing in-memory SQLite.File to edit
api/src/users.rsSetup helper
How to run
Sub-issues (pick one)