FIX: on topic page, don't try to render post counts for a deleted user

This commit is contained in:
Neil Lalonde
2015-01-15 15:39:26 -05:00
parent dc801bb442
commit 4a11bb5227
2 changed files with 7 additions and 0 deletions

View File

@@ -158,6 +158,12 @@ describe TopicView do
it 'returns the two posters with their counts' do
expect(topic_view.post_counts_by_user.to_a).to match_array([[first_poster.id, 2], [coding_horror.id, 1]])
end
it "doesn't return counts for posts with authors who have been deleted" do
p2.user_id = nil
p2.save!
expect(topic_view.post_counts_by_user.to_a).to match_array([[first_poster.id, 2]])
end
end
context '.participants' do