Archived
2

added user status and prediction user

This commit is contained in:
VLE2FE
2020-08-26 19:37:36 +02:00
parent efbf73032d
commit 597a8f3084
21 changed files with 477 additions and 80 deletions

View File

@ -632,6 +632,14 @@ describe('/sample', () => {
res: {status: 'Invalid body format', details: '"status[0]" must be one of [validated, new]'}
});
});
it('rejects requests from a predict user', done => {
TestHelper.request(server, done, {
method: 'get',
url: '/samples',
auth: {basic: 'customer'},
httpStatus: 403
});
});
it('rejects unauthorized requests', done => {
TestHelper.request(server, done, {
method: 'get',
@ -1789,7 +1797,7 @@ describe('/sample', () => {
should(res.body).have.property('user_id', '000000000000000000000002');
should(res.body).have.property('status', 'new');
should(res.body).have.property('added').be.type('string');
should(new Date().getTime() - new Date(res.body.added).getTime()).be.below(1000);
should(new Date().getTime() - new Date(res.body.added).getTime()).be.below(2000);
done();
});
});