Unsubscribe option available on website

This commit is contained in:
Alphonse Paix
2025-09-22 15:44:02 +02:00
parent a37123a32d
commit f1ce77a762
21 changed files with 400 additions and 91 deletions

View File

@@ -202,10 +202,10 @@ impl TestApp {
ConfirmationLinks { html, text }
}
pub async fn get_unsubscribe(&self, unsubscribe_token: String) -> reqwest::Response {
pub async fn get_unsubscribe_confirm(&self, unsubscribe_token: &str) -> reqwest::Response {
self.api_client
.get(format!(
"{}/unsubscribe?token={}",
"{}/unsubscribe/confirm?token={}",
&self.address, unsubscribe_token
))
.send()
@@ -298,6 +298,18 @@ impl TestApp {
.await
.expect("Failed to execute request")
}
pub async fn post_unsubscribe<Body>(&self, body: &Body) -> reqwest::Response
where
Body: serde::Serialize,
{
self.api_client
.post(format!("{}/unsubscribe", self.address))
.form(body)
.send()
.await
.expect("Failed to execute request")
}
}
async fn configure_database(config: &DatabaseSettings) -> PgPool {