mirror of
https://github.com/discourse/discourse.git
synced 2025-06-01 09:08:10 +08:00
FIX: Topic map was incorrectly counting assign actions (#10360)
The assign plugin is one of two situations where a post can be both a whisper and a small-action. Check the action_code field to filter out small-actions.
This commit is contained in:
@ -286,6 +286,8 @@ describe TopicView do
|
||||
context '.post_counts_by_user' do
|
||||
it 'returns the two posters with their appropriate counts' do
|
||||
Fabricate(:post, topic: topic, user: evil_trout, post_type: Post.types[:whisper])
|
||||
# Should not be counted
|
||||
Fabricate(:post, topic: topic, user: evil_trout, post_type: Post.types[:whisper], action_code: 'assign')
|
||||
|
||||
expect(TopicView.new(topic.id, admin).post_counts_by_user.to_a).to match_array([[first_poster.id, 2], [evil_trout.id, 2]])
|
||||
|
||||
|
Reference in New Issue
Block a user