Add test for Post::build_delete()
This commit is contained in:
parent
da7870eeba
commit
98e0754976
@ -1585,4 +1585,30 @@ mod tests {
|
|||||||
Ok(())
|
Ok(())
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn build_delete() {
|
||||||
|
let conn = db();
|
||||||
|
conn.test_transaction::<_, Error, _>(|| {
|
||||||
|
let (post, _mention, _posts, _users, _blogs) = prepare_activity(&conn);
|
||||||
|
let act = post.build_delete(&conn)?;
|
||||||
|
|
||||||
|
let expected = json!({
|
||||||
|
"actor": "https://plu.me/@/admin/",
|
||||||
|
"id": "https://plu.me/~/BlogName/testing#delete",
|
||||||
|
"object": {
|
||||||
|
"id": "https://plu.me/~/BlogName/testing",
|
||||||
|
"type": "Tombstone"
|
||||||
|
},
|
||||||
|
"to": [
|
||||||
|
"https://www.w3.org/ns/activitystreams#Public"
|
||||||
|
],
|
||||||
|
"type": "Delete"
|
||||||
|
});
|
||||||
|
|
||||||
|
assert_json_eq!(to_value(act)?, expected);
|
||||||
|
|
||||||
|
Ok(())
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user