mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user