DEV: Refactor reindex_search_spec.

DEV: Refactor reindex_search_spec.

Follow-up 20dc845418e13d23423fb986dc0fc10cdc07234a

diff --git a/spec/jobs/reindex_search_spec.rb b/spec/jobs/reindex_search_spec.rb
index 1cba71a..6f10dd2 100644
--- a/spec/jobs/reindex_search_spec.rb
+++ b/spec/jobs/reindex_search_spec.rb
@@ -35,16 +35,21 @@ describe Jobs::ReindexSearch do
   describe 'rebuild_problem_posts' do
     class FakeIndexer
       def self.index(post, force:)
-        @posts ||= []
-        @posts.push(post)
+        get_posts.push(post)
       end
 
       def self.posts
-        @posts ||= []
+        get_posts
       end
 
       def self.reset
-        @posts.clear
+        get_posts.clear
+      end
+
+      private
+
+      def self.get_posts
+        @posts ||= []
       end
     end
 

GitHub sha: 0cbf86f1