fix tests

This commit is contained in:
Matteo Pagliazzi
2015-12-19 18:23:13 +01:00
parent 3e87c8d3e9
commit 8b79f74e54
3 changed files with 4 additions and 3 deletions

View File

@@ -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
});
});

View File

@@ -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);
});
}

View File

@@ -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;