1
0
mirror of https://github.com/Foltik/Shimapan synced 2024-11-27 21:19:09 -05:00

Add user not found tests for ban/unban

This commit is contained in:
Jack Foltz 2018-08-13 06:23:46 -04:00
parent d28ce97ff5
commit e5c89eebb5
Signed by: foltik
GPG Key ID: 303F88F996E95541

View File

@ -903,6 +903,20 @@ describe('Users', () => {
return verifyBanned(res, 422, 'User not banned.', 'user', false);
});
});
describe('2 Not Found', () => {
it('must not ban a nonexistant user', async () => {
await util.createSession(agent, ['user.ban'], 'admin');
const res = await util.ban('abc', agent);
util.verifyResponse(res, 422, 'User not found.');
});
it('must not unban a nonexistant user', async () => {
await util.createSession(agent, ['user.unban'], 'admin');
const res = await util.unban('abc', agent);
util.verifyResponse(res, 422, 'User not found.');
});
});
});
});