search test

v1.18.x
barisusakli 10 years ago
parent 6d31fee3f5
commit ff770e3656

@ -157,6 +157,17 @@ describe('User', function() {
});
});
describe('.search()', function() {
it('should return an object containing an array of matching users', function(done) {
User.search({query: 'john'}, function(err, searchData) {
assert.ifError(err);
assert.equal(Array.isArray(searchData.users) && searchData.users.length > 0, true);
assert.equal(searchData.users[0].username, 'John Smith');
done();
});
});
});
after(function() {
db.flushdb();
});

Loading…
Cancel
Save