A platform for community discussion. Free, open, simple.
DEV: Fix flaky category hashtag spec (#19397)
Martin Brennan138dac925707
diff --git a/spec/services/category_hashtag_data_source_spec.rb b/spec/services/category_hashtag_data_source_spec.rbindex 7e0a88c9f7a..2084bb0ae65 100644--- a/spec/services/category_hashtag_data_source_spec.rb+++ b/spec/services/category_hashtag_data_source_spec.rb@@ -1,7 +1,7 @@# frozen_string_literal: trueRSpec.describe CategoryHashtagDataSource do- fab!(:parent_category) { Fabricate(:category, slug: "fun") }+ fab!(:parent_category) { Fabricate(:category, slug: "fun", topic_count: 2) }fab!(:category1) doFabricate(:category, slug: "random", topic_count: 12, parent_category: parent_category)end@@ -71,7 +71,7 @@ RSpec.describe CategoryHashtagDataSource dodescribe "#search_without_term" doit "returns distinct categories ordered by topic_count" doexpect(described_class.search_without_term(guardian, 5).map(&:slug)).to eq(- ["books", "movies", "casual", "random", "#{uncategorized_category.slug}"],+ ["books", "movies", "casual", "random", "fun"],)end