FIX: exclude suppressed category topics in digest even if unmuted. (#14793)

Previously, suppressed category topics are included in the digest emails if the user visited that topic before and the `TopicUser` record is created with any notification level except 'muted'.
This commit is contained in:
Vinoth Kannan
2021-11-03 12:47:09 +05:30
committed by GitHub
parent 3254d35078
commit 53b7220638
2 changed files with 6 additions and 2 deletions

View File

@@ -2071,11 +2071,15 @@ describe Topic do
it "doesn't return topics from suppressed categories" do
user = Fabricate(:user)
category = Fabricate(:category_with_definition, created_at: 2.minutes.ago)
Fabricate(:topic, category: category, created_at: 1.minute.ago)
topic = Fabricate(:topic, category: category, created_at: 1.minute.ago)
SiteSetting.digest_suppress_categories = "#{category.id}"
expect(Topic.for_digest(user, 1.year.ago, top_order: true)).to be_blank
Fabricate(:topic_user, user: user, topic: topic, notification_level: TopicUser.notification_levels[:regular])
expect(Topic.for_digest(user, 1.year.ago, top_order: true)).to be_blank
end
it "doesn't return topics from TL0 users" do