mirror of
https://github.com/discourse/discourse.git
synced 2025-05-30 15:28:37 +08:00
FIX: Do not update user stats like counts for private messages.
This commit is contained in:
@ -105,7 +105,7 @@ describe UserAction do
|
||||
|
||||
describe 'when user likes' do
|
||||
|
||||
let!(:post) { Fabricate(:post) }
|
||||
let(:post) { Fabricate(:post) }
|
||||
let(:likee) { post.user }
|
||||
let(:liker) { Fabricate(:coding_horror) }
|
||||
|
||||
@ -140,6 +140,23 @@ describe UserAction do
|
||||
expect(liker.user_stat.reload.likes_given).to eq(0)
|
||||
end
|
||||
|
||||
context 'private message' do
|
||||
let(:post) { Fabricate(:private_message_post) }
|
||||
let(:likee) { post.topic.topic_allowed_users.first.user }
|
||||
let(:liker) { post.topic.topic_allowed_users.last.user }
|
||||
|
||||
it 'should not increase user stats' do
|
||||
expect(@liker_action).not_to eq(nil)
|
||||
expect(liker.user_stat.reload.likes_given).to eq(0)
|
||||
expect(@likee_action).not_to eq(nil)
|
||||
expect(likee.user_stat.reload.likes_received).to eq(0)
|
||||
|
||||
PostAction.remove_act(liker, post, PostActionType.types[:like])
|
||||
expect(liker.user_stat.reload.likes_given).to eq(0)
|
||||
expect(likee.user_stat.reload.likes_received).to eq(0)
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
context "liking a private message" do
|
||||
|
Reference in New Issue
Block a user