DEV: Assume Topic#posts is ordered by post_number

DEV: Assume Topic#posts is ordered by post_number

diff --git a/spec/discourse_code_review/lib/github_pr_syncer_spec.rb b/spec/discourse_code_review/lib/github_pr_syncer_spec.rb
index dd13b6a..e49eed5 100644
--- a/spec/discourse_code_review/lib/github_pr_syncer_spec.rb
+++ b/spec/discourse_code_review/lib/github_pr_syncer_spec.rb
@@ -91,11 +91,11 @@ describe DiscourseCodeReview::GithubPRSyncer do
   end
 
   define_method(:first_post_of_last_topic) do
-    last_topic.posts.order('id ASC').first
+    last_topic.posts.first
   end
 
   define_method(:last_post_of_last_topic) do
-    last_topic.posts.order('id DESC').first
+    last_topic.posts.last
   end
 
   fab!(:category) do

GitHub sha: e2855735

1 Like