mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 16:34:31 +08:00
FIX: only show participants the user can see
This commit is contained in:
@ -160,13 +160,18 @@ describe TopicView do
|
||||
end
|
||||
|
||||
context '.post_counts_by_user' 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]])
|
||||
it 'returns the two posters with their appropriate counts' do
|
||||
Fabricate(:post, topic: topic, user: coding_horror, post_type: Post.types[:whisper])
|
||||
|
||||
expect(topic_view.post_counts_by_user.to_a).to match_array([[first_poster.id, 2], [coding_horror.id, 2]])
|
||||
|
||||
expect(TopicView.new(topic.id, first_poster).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
|
||||
|
Reference in New Issue
Block a user