diff --git a/script/helpers.coffee b/script/helpers.coffee index b5fbdf330f..2f2b63996f 100644 --- a/script/helpers.coffee +++ b/script/helpers.coffee @@ -76,7 +76,7 @@ module.exports = # _id / id handled by Racer stats: { gp: 0, exp: 0, lvl: 1, hp: 50 } invitations: {party:null, guilds: []} - items: { weapon: 0, armor: 0, head: 0, shield: 0 } + items: { weapon: 0, armor: 0, head: 0, shield: 0, lastDrop: { date: +new Date, count: 0 } } preferences: { gender: 'm', skin: 'white', hair: 'blond', armorSet: 'v1', dayStart:0, showHelm: true } apiToken: uuid() # set in newUserObject below lastCron: +new Date #this will be replaced with `+new Date` on first run diff --git a/tests/algos.mocha.coffee b/tests/algos.mocha.coffee index 13fe5a8a7e..390f83e34c 100644 --- a/tests/algos.mocha.coffee +++ b/tests/algos.mocha.coffee @@ -75,7 +75,11 @@ describe 'User', -> it 'sets correct user defaults', -> user = helpers.newUser() expect(user.stats).to.eql { gp: 0, exp: 0, lvl: 1, hp: 50 } - expect(user.items).to.eql { weapon: 0, armor: 0, head: 0, shield: 0 } + expect(user.items.weapon).to.eql 0 + expect(user.items.armor).to.eql 0 + expect(user.items.head).to.eql 0 + expect(user.items.shield).to.eql 0 + expect(user.items.lastDrop.count).to.eql 0 expect(user.preferences).to.eql { gender: 'm', skin: 'white', hair: 'blond', armorSet: 'v1', dayStart:0, showHelm: true } expect(user.balance).to.eql 0 expect(user.lastCron).to.be.greaterThan 0 @@ -95,7 +99,10 @@ describe 'User', -> user.weapon = 1 algos.revive user expect(user.stats).to.eql { gp: 0, exp: 0, lvl: 1, hp: 50 } - expect(user.items).to.eql { weapon: 0, armor: 0, head: 0, shield: 0 } + expect(user.items.weapon).to.eql 0 + expect(user.items.armor).to.eql 0 + expect(user.items.head).to.eql 0 + expect(user.items.shield).to.eql 0 describe 'store', -> it 'recovers hp buying potions', ->