Add test for delete_post()
This commit is contained in:
parent
d2e2b684e3
commit
f2575a0a79
1 changed files with 19 additions and 0 deletions
|
@ -1205,6 +1205,25 @@ mod tests {
|
||||||
assert_eq!(post.updated_at.is_some(), true);
|
assert_eq!(post.updated_at.is_some(), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[tokio::test]
|
||||||
|
#[serial]
|
||||||
|
async fn test_delete_post() {
|
||||||
|
let db_client = &mut create_test_database().await;
|
||||||
|
let user_data = UserCreateData {
|
||||||
|
username: "test".to_string(),
|
||||||
|
..Default::default()
|
||||||
|
};
|
||||||
|
let user = create_user(db_client, user_data).await.unwrap();
|
||||||
|
let post_data = PostCreateData {
|
||||||
|
content: "test post".to_string(),
|
||||||
|
..Default::default()
|
||||||
|
};
|
||||||
|
let post = create_post(db_client, &user.id, post_data).await.unwrap();
|
||||||
|
let deletion_queue = delete_post(db_client, &post.id).await.unwrap();
|
||||||
|
assert_eq!(deletion_queue.files.len(), 0);
|
||||||
|
assert_eq!(deletion_queue.ipfs_objects.len(), 0);
|
||||||
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
#[serial]
|
#[serial]
|
||||||
async fn test_home_timeline() {
|
async fn test_home_timeline() {
|
||||||
|
|
Loading…
Reference in a new issue