Merge branch 'master' into email-verification

This commit is contained in:
Wyatt Johnson
2017-10-18 09:34:32 -06:00
committed by GitHub
25 changed files with 430 additions and 211 deletions
+13
View File
@@ -166,6 +166,19 @@ describe('services.UsersService', () => {
const userAfterIgnoring2 = await UsersService.findById(user.id);
expect(userAfterIgnoring2.ignoresUsers.length).to.equal(2);
});
it('should not ignore a staff member', async () => {
const user = mockUsers[0];
const usersToIgnore = [mockUsers[1]];
await UsersService.addRoleToUser(usersToIgnore[0].id, 'STAFF');
try {
await UsersService.ignoreUsers(user.id, usersToIgnore.map((u) => u.id));
} catch (err) {
expect(err.status).to.equal(400);
expect(err.translation_key).to.equal('CANNOT_IGNORE_STAFF');
}
});
});
describe('#ban', () => {