fixed tests

This commit is contained in:
Wyatt Johnson
2017-12-21 12:43:26 -07:00
parent 4fb9910221
commit c8ab5cdbf6
3 changed files with 2 additions and 24 deletions
+1 -16
View File
@@ -278,27 +278,12 @@ describe('services.UsersService', () => {
await UsersService[func](user.id, user.username);
throw new Error('edit was processed successfully');
} catch (err) {
expect(err).have.property('translation_key', 'SAME_USERNAME_PROVIDED');
expect(err).have.property('translation_key', 'USERNAME_IN_USE');
}
} else {
await UsersService[func](user.id, user.username);
}
});
it('should refuse changing the username to one already taken', async () => {
const user = mockUsers[0];
const otherUser = mockUsers[1];
// Set the user to the desired status.
await UsersService.setUsernameStatus(user.id, okStatus);
try {
await UsersService[func](user.id, otherUser.username);
throw new Error('edit was processed successfully');
} catch (err) {
expect(err).have.property('translation_key', 'USERNAME_IN_USE');
}
});
});
});