From a8c64a4524aeeac3ea403ade489c1be75c5252d0 Mon Sep 17 00:00:00 2001 From: Joby Walker Date: Sat, 2 Aug 2014 14:18:39 -0700 Subject: [PATCH] Use explicit get for 'quest' Quest is currently set to null when quests end. Mongoose wraps the value in an object so the test will fail. --- test/api.mocha.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/api.mocha.js b/test/api.mocha.js index 681c3aef98..9e71e48266 100644 --- a/test/api.mocha.js +++ b/test/api.mocha.js @@ -545,8 +545,9 @@ describe('API', function () { // Tavern Boss function(cb2){ Group.findById('habitrpg',function(err,tavern){ - expect(_.isEmpty(tavern.quest)).to.be(true); expect(user.items.pets['MantisShrimp-Base']).to.be(true); + //use an explicit get because mongoose wraps the null in an object + expect(_.isEmpty(tavern.get('quest'))).to.be(true); expect(user.items.mounts['MantisShrimp-Base']).to.be(true); expect(user.items.eggs.Dragon).to.be(2); expect(user.items.hatchingPotions.Shade).to.be(2); @@ -556,7 +557,8 @@ describe('API', function () { // Party Boss function(cb2){ - expect(_.isEmpty(_group.quest)).to.be(true); + //use an explicit get because mongoose wraps the null in an object + expect(_.isEmpty(_group.get('quest'))).to.be(true); expect(user.items.gear.owned.weapon_special_2).to.be(true); expect(user.items.eggs.Dragon).to.be(2); expect(user.items.hatchingPotions.Shade).to.be(2);