From 0979471e542b41889751dae0b1afd63e6e999bcc Mon Sep 17 00:00:00 2001 From: Kitaiti Makoto Date: Sun, 13 Feb 2022 18:48:16 +0900 Subject: [PATCH] Add test for User::delete_activity07() --- plume-models/src/users.rs | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/plume-models/src/users.rs b/plume-models/src/users.rs index 5e8f79a7..b64b451e 100644 --- a/plume-models/src/users.rs +++ b/plume-models/src/users.rs @@ -1802,6 +1802,32 @@ pub(crate) mod tests { }); } + #[test] + fn delete_activity07() { + let conn = db(); + conn.test_transaction::<_, Error, _>(|| { + let users = fill_database(&conn); + let user = &users[1]; + let act = user.delete_activity07(&conn)?; + + let expected = json!({ + "actor": "https://plu.me/@/user/", + "cc": [], + "id": "https://plu.me/@/user/#delete", + "object": { + "id": "https://plu.me/@/user/", + "type": "Tombstone", + }, + "to": ["https://www.w3.org/ns/activitystreams#Public"], + "type": "Delete", + }); + + assert_json_eq!(to_value(act)?, expected); + + Ok(()) + }); + } + #[test] fn outbox_collection() { let conn = db();