diff --git a/test/spec/specHelper.js b/test/spec/specHelper.js index 8ce17cff59..eb818a6ee0 100644 --- a/test/spec/specHelper.js +++ b/test/spec/specHelper.js @@ -13,20 +13,24 @@ var specHelper = {}; specHelper.newReward = newReward; specHelper.newChallenge = newChallenge; - function newUser() { - var buffs = {per:0, int:0, con:0, str:0, stealth: 0, streaks: false}; + function newUser(overrides) { + var buffs = { per:0, int:0, con:0, str:0, stealth: 0, streaks: false }; + var stats = { str:1, con:1, per:1, int:1, mp: 32, class: 'warrior', buffs: buffs, gp: 0 }; + var items = { + lastDrop: { count: 0 }, + hatchingPotions: {}, + eggs: {}, + food: {}, + pets: {}, + mounts: {}, + gear: { equipped: {}, costume: {}, owned: {} } + }; + user = { - auth:{timestamps: {}}, - stats: {str:1, con:1, per:1, int:1, mp: 32, class: 'warrior', buffs: buffs, gp: 0}, - items:{ - lastDrop:{count: 0}, - hatchingPotions: {}, - eggs: {}, - food: {}, - pets: {}, - mounts: {}, - gear: {equipped: {}, costume: {}, owned: {}} - }, + _id: 'unique-user-id', + auth: { timestamps: {} }, + stats: stats, + items: items, party: { quest: { progress: {down: 0} @@ -41,6 +45,9 @@ var specHelper = {}; filters: {}, achievements: {} }; + + _setOverrides(user, overrides); + return user; }