From 8b79f74e54e32ff7d64740d708d1a6a79ff9c317 Mon Sep 17 00:00:00 2001 From: Matteo Pagliazzi Date: Sat, 19 Dec 2015 18:23:13 +0100 Subject: [PATCH] fix tests --- test/api/v3/integration/chat/GET-chat.test.js | 4 +++- test/helpers/api-integration.helper.js | 2 +- website/src/controllers/api-v3/groups.js | 1 - 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/test/api/v3/integration/chat/GET-chat.test.js b/test/api/v3/integration/chat/GET-chat.test.js index f1fe89c5d6..206eac6f75 100644 --- a/test/api/v3/integration/chat/GET-chat.test.js +++ b/test/api/v3/integration/chat/GET-chat.test.js @@ -11,7 +11,6 @@ describe('GET /groups/:groupId/chat', () => { before(() => { return generateUser({balance: 2}).then((generatedUser) => { user = generatedUser; - console.log(user._id, user.balance) api = requester(user); }); }); @@ -24,6 +23,7 @@ describe('GET /groups/:groupId/chat', () => { name: 'test group', type: 'guild', privacy: 'public', + }, { chat: [ 'Hello', 'Welcome to the Guild', @@ -40,5 +40,7 @@ describe('GET /groups/:groupId/chat', () => { expect(getChat).to.eql(group.chat); }); }); + + // TODO tests that you can only access your groups' chat }); }); diff --git a/test/helpers/api-integration.helper.js b/test/helpers/api-integration.helper.js index 9b865ccb85..81718c36c8 100644 --- a/test/helpers/api-integration.helper.js +++ b/test/helpers/api-integration.helper.js @@ -110,7 +110,7 @@ export function generateGroup (leader, details = {}, update = {}) { request('/groups', details).then((group) => { _updateDocument('groups', group, update, () => { resolve(group); - }).catch(reject); + }); }).catch(reject); }); } diff --git a/website/src/controllers/api-v3/groups.js b/website/src/controllers/api-v3/groups.js index c431db872f..8843b7aff7 100644 --- a/website/src/controllers/api-v3/groups.js +++ b/website/src/controllers/api-v3/groups.js @@ -31,7 +31,6 @@ api.createGroup = { group.leader = user._id; if (group.type === 'guild') { - console.log(user._id, user.balance) if (user.balance < 1) return next(new NotAuthorized(res.t('messageInsufficientGems'))); group.balance = 1;