fix: remove guild or party when user looks it up if it does not exist

closes #7878
fixes #7724
This commit is contained in:
Husman
2016-08-06 17:28:07 -07:00
committed by Blade Barringer
parent ae533652c3
commit bba56b8c29
5 changed files with 101 additions and 6 deletions

View File

@@ -327,7 +327,7 @@ describe('Post /groups/:groupId/invite', () => {
});
});
it('allow inviting a user to a party if he\'s partying solo', async () => {
it('allow inviting a user to a party if they are partying solo', async () => {
let userToInvite = await generateUser();
await userToInvite.post('/groups', { // add user to a party
name: 'Another Test Party',
@@ -339,5 +339,16 @@ describe('Post /groups/:groupId/invite', () => {
});
expect((await userToInvite.get('/user')).invitations.party.id).to.equal(party._id);
});
it('allow inviting a user if party id is not associated with a real party', async () => {
let userToInvite = await generateUser({
party: { _id: generateUUID() },
});
await inviter.post(`/groups/${party._id}/invite`, {
uuids: [userToInvite._id],
});
expect((await userToInvite.get('/user')).invitations.party.id).to.equal(party._id);
});
});
});