SPEC: make sure digest doesn't pick any topics in categories that are muted

This commit is contained in:
Régis Hanol
2014-11-03 16:57:50 +01:00
parent a7fa1b33e5
commit fd5677808c
4 changed files with 34 additions and 32 deletions

View File

@@ -1181,6 +1181,16 @@ describe Topic do
Topic.for_digest(user, 1.year.ago, top_order: true).should == [topic]
end
it "doesn't return topics from muted categories" do
user = Fabricate(:user)
category = Fabricate(:category)
topic = Fabricate(:topic, category: category)
CategoryUser.set_notification_level_for_category(user, CategoryUser.notification_levels[:muted], category.id)
Topic.for_digest(user, 1.year.ago, top_order: true).should be_blank
end
end
describe 'secured' do