mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-01-26 09:19:55 +01:00
search test
This commit is contained in:
@@ -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();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user