mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Break down new topic counts by category if a digest contains many.
This commit is contained in:
@@ -52,6 +52,7 @@ describe UserNotifications do
|
||||
context "with new topics" do
|
||||
before do
|
||||
Topic.expects(:for_digest).returns([Fabricate(:topic, user: Fabricate(:coding_horror))])
|
||||
Topic.expects(:new_since_last_seen).returns(Topic.none)
|
||||
end
|
||||
|
||||
its(:to) { should == [user.email] }
|
||||
|
||||
@@ -1194,17 +1194,17 @@ describe Topic do
|
||||
let(:user) { Fabricate.build(:user) }
|
||||
|
||||
it "returns none when there are no topics" do
|
||||
Topic.for_digest(user, 1.year.ago).should be_blank
|
||||
Topic.for_digest(user, 1.year.ago, top_order: true).should be_blank
|
||||
end
|
||||
|
||||
it "doesn't return category topics" do
|
||||
Fabricate(:category)
|
||||
Topic.for_digest(user, 1.year.ago).should be_blank
|
||||
Topic.for_digest(user, 1.year.ago, top_order: true).should be_blank
|
||||
end
|
||||
|
||||
it "returns regular topics" do
|
||||
topic = Fabricate(:topic)
|
||||
Topic.for_digest(user, 1.year.ago).should == [topic]
|
||||
Topic.for_digest(user, 1.year.ago, top_order: true).should == [topic]
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user