mirror of
https://git.joinplu.me/Plume/Plume.git
synced 2024-12-25 03:20:32 +00:00
Add test for Blog::outbox_collection_page()
This commit is contained in:
parent
f5e776c4d7
commit
67996cc938
1 changed files with 21 additions and 0 deletions
|
@ -1156,4 +1156,25 @@ pub(crate) mod tests {
|
||||||
Ok(())
|
Ok(())
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn outbox_collection_page() {
|
||||||
|
let conn = &db();
|
||||||
|
conn.test_transaction::<_, Error, _>(|| {
|
||||||
|
let (_users, blogs) = fill_database(conn);
|
||||||
|
let blog = &blogs[0];
|
||||||
|
let act = blog.outbox_collection_page(conn, (33, 36))?;
|
||||||
|
|
||||||
|
let expected = json!({
|
||||||
|
"next": "https://plu.me/~/BlogName/outbox?page=3",
|
||||||
|
"prev": "https://plu.me/~/BlogName/outbox?page=1",
|
||||||
|
"items": [],
|
||||||
|
"type": "OrderedCollectionPage"
|
||||||
|
});
|
||||||
|
|
||||||
|
assert_json_eq!(to_value(act)?, expected);
|
||||||
|
|
||||||
|
Ok(())
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue