search tests

new method emptydb
use emptydb instead of flushdb, flushdb  removes indices for mongo which
breaks search tests
initialize meta.config properly in tests
enable nodebb-plugin-dbsearch for tests
This commit is contained in:
barisusakli
2016-10-17 23:34:09 +03:00
parent d106ca9ce3
commit 4a0f67afdc
19 changed files with 221 additions and 20 deletions

View File

@@ -13,9 +13,9 @@ describe('Messaging Library', function () {
before(function (done) {
// Create 3 users: 1 admin, 2 regular
async.parallel([
async.apply(User.create, { username: 'foo', password: 'bar' }), // admin
async.apply(User.create, { username: 'baz', password: 'quux' }), // restricted user
async.apply(User.create, { username: 'herp', password: 'derp' }) // regular user
async.apply(User.create, { username: 'foo', password: 'barbar' }), // admin
async.apply(User.create, { username: 'baz', password: 'quuxquux' }), // restricted user
async.apply(User.create, { username: 'herp', password: 'derpderp' }) // regular user
], function (err, uids) {
if (err) {
return done(err);
@@ -71,6 +71,6 @@ describe('Messaging Library', function () {
});
after(function (done) {
db.flushdb(done);
db.emptydb(done);
});
});