Support username search in user listing api
This commit is contained in:
@@ -523,7 +523,7 @@ describe('database', function () {
|
||||
});
|
||||
|
||||
it('can get all with group ids paged', function (done) {
|
||||
userdb.getAllWithGroupIdsPaged(1, 2, function (error, all) {
|
||||
userdb.getAllWithGroupIdsPaged(null, 1, 2, function (error, all) {
|
||||
expect(error).to.not.be.ok();
|
||||
expect(all.length).to.equal(2);
|
||||
|
||||
@@ -537,7 +537,7 @@ describe('database', function () {
|
||||
userCopy.groupIds = [];
|
||||
expect(all[1]).to.eql(userCopy);
|
||||
|
||||
userdb.getAllWithGroupIdsPaged(2, 2, function (error, all) {
|
||||
userdb.getAllWithGroupIdsPaged(null, 2, 2, function (error, all) {
|
||||
expect(error).to.not.be.ok();
|
||||
expect(all.length).to.equal(1);
|
||||
|
||||
@@ -552,6 +552,21 @@ describe('database', function () {
|
||||
});
|
||||
});
|
||||
|
||||
it('can get all with group ids paged and search', function (done) {
|
||||
userdb.getAllWithGroupIdsPaged('id1', 1, 2, function (error, all) {
|
||||
expect(error).to.not.be.ok();
|
||||
expect(all.length).to.equal(1);
|
||||
|
||||
var userCopy;
|
||||
|
||||
userCopy = _.extend({}, USER_1);
|
||||
userCopy.groupIds = [];
|
||||
expect(all[0]).to.eql(userCopy);
|
||||
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it('can get all admins', function (done) {
|
||||
userdb.getAllAdmins(function (error, all) {
|
||||
expect(error).to.not.be.ok();
|
||||
|
||||
Reference in New Issue
Block a user