feat: red test implementation of email confirm

This commit is contained in:
Sandro Eiler 2024-04-18 14:31:06 +02:00
parent 7eebcb12a2
commit 8045eb979e
8 changed files with 75 additions and 9 deletions

View file

@ -25,6 +25,7 @@ static TRACING: Lazy<()> = Lazy::new(|| {
pub struct TestApp {
pub address: String,
pub port: u16,
pub db_pool: PgPool,
pub email_server: MockServer,
}
@ -75,14 +76,15 @@ pub async fn spawn_app() -> TestApp {
.await
.expect("Failed to build application.");
// Get the port before spawning the application
let address = format!("http://127.0.0.1:{}", application.port());
let application_port = application.port();
let address = format!("http://127.0.0.1:{}", application_port);
// Launch the application as a background task
tokio::spawn(async move { application.run().await.expect("Failed to run the server") });
TestApp {
address,
// port: application_port,
port: application_port,
db_pool: connection_pool,
email_server,
// test_user: TestUser::generate(),