From 7194289f14f2a4bb7d4419ae49541786425b5aa1 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Sun, 7 Apr 2019 22:35:18 -0700 Subject: [PATCH] Fixing unit tests. --- server/src/actions/comment_view.rs | 4 ++-- server/src/actions/post_view.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/server/src/actions/comment_view.rs b/server/src/actions/comment_view.rs index 417a6772..3b4e00bb 100644 --- a/server/src/actions/comment_view.rs +++ b/server/src/actions/comment_view.rs @@ -208,8 +208,8 @@ mod tests { my_vote: Some(1), }; - let read_comment_views_no_user = CommentView::list(&conn, inserted_post.id, None).unwrap(); - let read_comment_views_with_user = CommentView::list(&conn, inserted_post.id, Some(inserted_user.id)).unwrap(); + let read_comment_views_no_user = CommentView::list(&conn, &SortType::New, Some(inserted_post.id), None, None, 999).unwrap(); + let read_comment_views_with_user = CommentView::list(&conn, &SortType::New, Some(inserted_post.id), None, Some(inserted_user.id), 999).unwrap(); let like_removed = CommentLike::remove(&conn, &comment_like_form).unwrap(); let num_deleted = Comment::delete(&conn, inserted_comment.id).unwrap(); Post::delete(&conn, inserted_post.id).unwrap(); diff --git a/server/src/actions/post_view.rs b/server/src/actions/post_view.rs index 6afba18d..6ca85c34 100644 --- a/server/src/actions/post_view.rs +++ b/server/src/actions/post_view.rs @@ -249,8 +249,8 @@ mod tests { }; - let read_post_listings_with_user = PostView::list(&conn, PostListingType::Community, SortType::New, Some(inserted_community.id), Some(inserted_user.id), 10).unwrap(); - let read_post_listings_no_user = PostView::list(&conn, PostListingType::Community, SortType::New, Some(inserted_community.id), None, 10).unwrap(); + let read_post_listings_with_user = PostView::list(&conn, PostListingType::Community, &SortType::New, Some(inserted_community.id), None, Some(inserted_user.id), 10).unwrap(); + let read_post_listings_no_user = PostView::list(&conn, PostListingType::Community, &SortType::New, Some(inserted_community.id), None, None, 10).unwrap(); let read_post_listing_no_user = PostView::read(&conn, inserted_post.id, None).unwrap(); let read_post_listing_with_user = PostView::read(&conn, inserted_post.id, Some(inserted_user.id)).unwrap(); -- 2.44.1