FEATURE: digest emails will try to choose topics from your tracked and watched categories first

This commit is contained in:
Neil Lalonde
2016-08-15 16:16:04 -04:00
parent f60bfe7550
commit 5849c345cc
3 changed files with 16 additions and 1 deletions
+10
View File
@@ -1382,6 +1382,16 @@ describe Topic do
expect(Topic.for_digest(user, 1.year.ago, top_order: true)).to eq([topic])
end
it "sorts by category notification levels" do
category1, category2 = Fabricate(:category), Fabricate(:category)
2.times {|i| Fabricate(:topic, category: category1) }
topic1 = Fabricate(:topic, category: category2)
2.times {|i| Fabricate(:topic, category: category1) }
CategoryUser.create(user: user, category: category2, notification_level: CategoryUser.notification_levels[:watching])
for_digest = Topic.for_digest(user, 1.year.ago, top_order: true)
expect(for_digest.first).to eq(topic1)
end
end
describe 'secured' do