mirror of
https://github.com/discourse/discourse.git
synced 2025-09-06 09:10:25 +08:00
FIX: summary email excludes all untagged topics if user has muted some tags
This commit is contained in:
parent
35ff5d6796
commit
3964929c75
2 changed files with 12 additions and 1 deletions
|
@ -1413,6 +1413,17 @@ describe Topic do
|
|||
expect(Topic.for_digest(user, 1.year.ago, top_order: true)).to eq([topic])
|
||||
end
|
||||
|
||||
it "returns topics with no tags too" do
|
||||
user = Fabricate(:user)
|
||||
muted_tag, other_tag = Fabricate(:tag), Fabricate(:tag)
|
||||
TagUser.change(user.id, muted_tag.id, TagUser.notification_levels[:muted])
|
||||
topic1 = Fabricate(:topic, tags: [muted_tag])
|
||||
topic2 = Fabricate(:topic, tags: [other_tag])
|
||||
topic3 = Fabricate(:topic)
|
||||
|
||||
expect(Topic.for_digest(user, 1.year.ago, top_order: true)).to contain_exactly(topic2, topic3)
|
||||
end
|
||||
|
||||
it "sorts by category notification levels" do
|
||||
category1, category2 = Fabricate(:category), Fabricate(:category)
|
||||
2.times {|i| Fabricate(:topic, category: category1) }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue