mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Liking whispers should not contribute to Topic#like_count. (#15703)
Non-staff users are not allowed to see whisper so this change prevents
non-staff user from seeing a like count that does not make sense to
them. In the future, we might consider adding another like count column
for staff user.
Follow-up to 4492718864
This commit is contained in:
committed by
GitHub
parent
16910eba1d
commit
4aa9a813ec
@@ -456,6 +456,16 @@ describe PostAction do
|
||||
expect(notification.notification_type).to eq(Notification.types[:liked])
|
||||
end
|
||||
|
||||
it 'should not increase topic like count when liking a whisper' do
|
||||
SiteSetting.set(:enable_whispers, true)
|
||||
post.revise(admin, post_type: Post.types[:whisper])
|
||||
|
||||
PostActionCreator.like(admin, post)
|
||||
|
||||
expect(post.reload.like_count).to eq(1)
|
||||
expect(post.topic.like_count).to eq(0)
|
||||
end
|
||||
|
||||
it 'should increase the `like_count` and `like_score` when a user likes something' do
|
||||
freeze_time Date.today
|
||||
|
||||
|
||||
Reference in New Issue
Block a user