Add test for Blog::outbox_collection_page()

This commit is contained in:
Kitaiti Makoto 2022-02-23 02:29:01 +09:00
parent f5e776c4d7
commit 67996cc938

View File

@ -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(())
});
}
} }