diff --git a/spec/jobs/reindex_search_spec.rb b/spec/jobs/reindex_search_spec.rb index 1cba71a87a8..6f10dd203a8 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