Comment posting is idempotent + tests

This commit is contained in:
Alphonse Paix
2025-10-05 15:01:57 +02:00
parent 8f62c2513e
commit d96a29ee73
15 changed files with 289 additions and 95 deletions

View File

@@ -359,6 +359,18 @@ impl TestApp {
.expect("Failed to execute request")
}
pub async fn post_comment<Body>(&self, post_id: &Uuid, body: &Body) -> reqwest::Response
where
Body: serde::Serialize,
{
self.api_client
.post(format!("{}/posts/{post_id}/comments", self.address))
.form(body)
.send()
.await
.expect("Failed to execute request")
}
pub async fn delete_post(&self, post_id: Uuid) {
self.api_client
.delete(format!("{}/admin/posts/{}", self.address, post_id))