added user status and prediction user
This commit is contained in:
@ -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();
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user