diff --git a/test/api/v3/integration/groups/GET-groups.test.js b/test/api/v3/integration/groups/GET-groups.test.js index b37b87f890..7e2014e87c 100644 --- a/test/api/v3/integration/groups/GET-groups.test.js +++ b/test/api/v3/integration/groups/GET-groups.test.js @@ -3,6 +3,9 @@ import { resetHabiticaDB, generateGroup, } from '../../../../helpers/api-v3-integration.helper'; +import { + TAVERN_ID, +} from '../../../../../website/src/models/group'; describe('GET /groups', () => { let user; @@ -70,7 +73,7 @@ describe('GET /groups', () => { await expect(user.get('/groups?type=tavern')) .to.eventually.have.a.lengthOf(1) .and.to.have.deep.property('[0]') - .and.to.have.property('_id', 'habitrpg'); + .and.to.have.property('_id', TAVERN_ID); }); it('returns only the user\'s party when party passed in as query', async () => { diff --git a/test/helpers/mongo.js b/test/helpers/mongo.js index d99c195c3c..463f375e8e 100644 --- a/test/helpers/mongo.js +++ b/test/helpers/mongo.js @@ -1,4 +1,5 @@ import mongoose from 'mongoose'; +import { TAVERN_ID } from '../../website/src/models/group'; // Useful for checking things that have been deleted, // but you no longer have access to, @@ -26,12 +27,12 @@ export async function resetHabiticaDB () { let groups = mongoose.connection.db.collection('groups'); // For some mysterious reason after a dropDatabase there can still be a group... - groups.count({_id: 'habitrpg'}, (err, count) => { + groups.count({_id: TAVERN_ID}, (err, count) => { if (err) return reject(err); if (count > 0) return resolve(); groups.insertOne({ - _id: 'habitrpg', + _id: TAVERN_ID, chat: [], leader: '9', name: 'HabitRPG', diff --git a/website/src/middlewares/api-v3/cron.js b/website/src/middlewares/api-v3/cron.js index 5b1aea9114..c82c0fc647 100644 --- a/website/src/middlewares/api-v3/cron.js +++ b/website/src/middlewares/api-v3/cron.js @@ -261,7 +261,6 @@ function cron (options = {}) { gaLabel: 'Cron Count', gaValue: user.flags.cronCount, uuid: user._id, - user, // TODO is it really necessary passing the whole user object? resting: user.preferences.sleep, cronCount: user.flags.cronCount, progressUp: _.min([_progress.up, 900]),