switched to aggregation, included material sort keys
This commit is contained in:
@ -230,6 +230,20 @@ describe('/sample', () => {
|
||||
done();
|
||||
});
|
||||
});
|
||||
it('sorts the samples correctly for material keys', done => {
|
||||
TestHelper.request(server, done, {
|
||||
method: 'get',
|
||||
url: '/samples?status=all&sort=material.name-desc',
|
||||
auth: {basic: 'janedoe'},
|
||||
httpStatus: 200
|
||||
}).end((err, res) => {
|
||||
if (err) return done(err);
|
||||
should(res.body[0]).have.property('_id', '400000000000000000000002');
|
||||
should(res.body[1]).have.property('_id', '400000000000000000000006');
|
||||
should(res.body[2]).have.property('_id', '400000000000000000000001');
|
||||
done();
|
||||
});
|
||||
});
|
||||
it('rejects a negative page size', done => {
|
||||
TestHelper.request(server, done, {
|
||||
method: 'get',
|
||||
|
Reference in New Issue
Block a user