mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 07:07:35 +01:00
Add method to remove blank uuids
This commit is contained in:
@@ -109,6 +109,20 @@ describe('Invite to Group Controller', function() {
|
||||
|
||||
expect(scope.invitees).to.eql([{uuid: ''}]);
|
||||
});
|
||||
|
||||
it('removes blank fields from being sent', function() {
|
||||
groups.Group.invite.yields();
|
||||
scope.invitees = [{uuid: 'user1'}, {uuid: ''}, {uuid: 'user3'}];
|
||||
|
||||
scope.inviteNewUsers('uuid');
|
||||
|
||||
expect(groups.Group.invite).to.be.calledOnce;
|
||||
expect(groups.Group.invite).to.be.calledWith({
|
||||
gid: scope.group._id,
|
||||
}, {
|
||||
uuids: ['user1', 'user3']
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
context('invalid invite method', function() {
|
||||
|
||||
Reference in New Issue
Block a user