mirror of
https://git.joinplu.me/Plume/Plume.git
synced 2024-11-26 13:31:02 +00:00
Add test for Follow::build_accept07()
This commit is contained in:
parent
9343d3a120
commit
38a55857c6
1 changed files with 29 additions and 0 deletions
|
@ -380,6 +380,35 @@ mod tests {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn build_accept07() {
|
||||||
|
let conn = db();
|
||||||
|
conn.test_transaction::<_, Error, _>(|| {
|
||||||
|
let (follow, following, follower, _users) = prepare_activity(&conn);
|
||||||
|
let act = follow.build_accept07(&follower, &following, follow.to_activity07(&conn)?)?;
|
||||||
|
|
||||||
|
let expected = json!({
|
||||||
|
"actor": "https://plu.me/@/user/",
|
||||||
|
"cc": ["https://www.w3.org/ns/activitystreams#Public"],
|
||||||
|
"id": format!("https://127.0.0.1:7878/follows/{}/accept", follow.id),
|
||||||
|
"object": {
|
||||||
|
"actor": "https://plu.me/@/other/",
|
||||||
|
"cc": ["https://www.w3.org/ns/activitystreams#Public"],
|
||||||
|
"id": format!("https://plu.me/follows/{}", follow.id),
|
||||||
|
"object": "https://plu.me/@/user/",
|
||||||
|
"to": ["https://plu.me/@/user/"],
|
||||||
|
"type": "Follow"
|
||||||
|
},
|
||||||
|
"to": ["https://plu.me/@/other/"],
|
||||||
|
"type": "Accept"
|
||||||
|
});
|
||||||
|
|
||||||
|
assert_json_eq!(to_value(act)?, expected);
|
||||||
|
|
||||||
|
Ok(())
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn build_undo() {
|
fn build_undo() {
|
||||||
let conn = db();
|
let conn = db();
|
||||||
|
|
Loading…
Reference in a new issue