Added summary field tests (#9883)

* Added summary field tests

* Fixed typo
This commit is contained in:
Keith Holliday
2018-02-05 09:52:44 -07:00
committed by GitHub
parent 2d612b655d
commit 0f4b8f5f30
2 changed files with 54 additions and 0 deletions

View File

@@ -44,6 +44,32 @@ describe('POST /group', () => {
},
});
});
it('sets summary to groups name when not supplied', async () => {
const name = 'Test Group';
const group = await user.post('/groups', {
name,
type: 'guild',
});
const updatedGroup = await user.get(`/groups/${group._id}`);
expect(updatedGroup.summary).to.eql(name);
});
it('sets summary to groups', async () => {
const name = 'Test Group';
const summary = 'Test Summary';
const group = await user.post('/groups', {
name,
type: 'guild',
summary,
});
const updatedGroup = await user.get(`/groups/${group._id}`);
expect(updatedGroup.summary).to.eql(summary);
});
});
context('Guilds', () => {