FIX: admin dashboard posts count should not include system posts and whispers

This commit is contained in:
Neil Lalonde
2017-02-21 14:45:34 -05:00
parent c216f59eaa
commit c94fdcea38
2 changed files with 12 additions and 2 deletions

View File

@@ -209,5 +209,15 @@ describe Report do
end
end
end
end
describe 'posts counts' do
it "only counts regular posts" do
post = Fabricate(:post)
Fabricate(:moderator_post, topic: post.topic)
Fabricate.build(:post, post_type: Post.types[:whisper], topic: post.topic)
post.topic.add_small_action(Fabricate(:admin), "invited_group", 'coolkids')
r = Report.find('posts')
expect(r.total).to eq(1)
end
end
end