FIX: Don't count likes from system users in the new user of the month

This commit is contained in:
Robin Ward 2017-05-15 13:14:15 -04:00
parent e1dd543a93
commit bd0bb879e5
2 changed files with 2 additions and 0 deletions

View File

@ -41,6 +41,7 @@ module Jobs
SUM(CASE
WHEN pa.id IS NOT NULL THEN
CASE
WHEN liked_by.id <= 0 THEN 0.0
WHEN liked_by.admin OR liked_by.moderator THEN 2.0
WHEN liked_by.trust_level = 0 THEN 0.1
WHEN liked_by.trust_level = 1 THEN 0.25

View File

@ -149,6 +149,7 @@ describe Jobs::GrantNewUserOfTheMonthBadges do
PostAction.act(u4, p, PostActionType.types[:like])
PostAction.act(um, p, PostActionType.types[:like])
PostAction.act(ua, p, PostActionType.types[:like])
PostAction.act(Discourse.system_user, p, PostActionType.types[:like])
expect(granter.scores[user.id]).to eq(4.425)
# It goes down the more they post