lint: Fix linting errors in api v2 tests

This commit is contained in:
Blade Barringer
2016-01-02 22:19:47 -06:00
parent ff1e5ef221
commit 116fffaf4f
23 changed files with 307 additions and 403 deletions

View File

@@ -5,7 +5,6 @@ import {
} from '../../../helpers/api-integration.helper';
describe('POST /groups/:id', () => {
context('user is not the leader of the group', () => {
let user, otherUser, groupUserDoesNotOwn;
@@ -30,7 +29,7 @@ describe('POST /groups/:id', () => {
it('does not allow user to update group', async () => {
return expect(user.post(`/groups/${groupUserDoesNotOwn._id}`, {
name: 'Change'
name: 'Change',
})).to.eventually.be.rejected.and.eql({
code: 401,
text: t('messageGroupOnlyLeaderCanUpdate'),
@@ -42,31 +41,27 @@ describe('POST /groups/:id', () => {
let user, usersGroup;
beforeEach(async () => {
return generateUser({
user = await generateUser({
balance: 10,
}).then((_user) => {
user = _user;
});
return generateGroup(user, {
name: 'Original Group Title',
type: 'guild',
privacy: 'public',
});
}).then((group) => {
usersGroup = group;
usersGroup = await generateGroup(user, {
name: 'Original Group Title',
type: 'guild',
privacy: 'public',
});
});
it('allows user to update group', async () => {
return user.post(`/groups/${usersGroup._id}`, {
await user.post(`/groups/${usersGroup._id}`, {
name: 'New Group Title',
description: 'New group description',
}).then((group) => {
return user.get(`/groups/${usersGroup._id}`);
}).then((group) => {
expect(group.name).to.eql('New Group Title');
expect(group.description).to.eql('New group description');
});
let group = await user.get(`/groups/${usersGroup._id}`);
expect(group.name).to.eql('New Group Title');
expect(group.description).to.eql('New group description');
});
});
});