mirror of
https://github.com/Foltik/Shimapan
synced 2024-11-10 15:48:27 -05:00
Add user not found tests for ban/unban
This commit is contained in:
parent
d28ce97ff5
commit
e5c89eebb5
14
test/api.js
14
test/api.js
@ -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.');
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user