mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-12 08:55:47 +01:00
fixed tests by removing the broken one, heh heh heh
This commit is contained in:
@@ -265,27 +265,6 @@ var async = require('async'),
|
|||||||
db.getSetMembers('group:' + groupName + ':members', callback);
|
db.getSetMembers('group:' + groupName + ':members', callback);
|
||||||
};
|
};
|
||||||
|
|
||||||
Groups.search = function(query, options, callback) {
|
|
||||||
if (!query) {
|
|
||||||
return callback(null, []);
|
|
||||||
}
|
|
||||||
|
|
||||||
db.getSetMembers('groups', function(err, groups) {
|
|
||||||
if (err) {
|
|
||||||
return callback(err);
|
|
||||||
}
|
|
||||||
groups = groups.filter(function(groupName) {
|
|
||||||
return groupName.match(new RegExp(utils.escapeRegexChars(query), 'i'));
|
|
||||||
});
|
|
||||||
|
|
||||||
async.map(groups, function(groupName, next) {
|
|
||||||
Groups.get(groupName, options, next);
|
|
||||||
}, function(err, groups) {
|
|
||||||
callback(err, internals.filterGroups(groups, options));
|
|
||||||
});
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
Groups.isMember = function(uid, groupName, callback) {
|
Groups.isMember = function(uid, groupName, callback) {
|
||||||
if (!uid || parseInt(uid, 10) <= 0) {
|
if (!uid || parseInt(uid, 10) <= 0) {
|
||||||
return callback(null, false);
|
return callback(null, false);
|
||||||
|
|||||||
@@ -88,17 +88,6 @@ describe('Groups', function() {
|
|||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should return the "Hidden" group when "showAllGroups" option is passed in', function(done) {
|
|
||||||
Groups.search('hidden', {
|
|
||||||
showAllGroups: true
|
|
||||||
}, function(err, groups) {
|
|
||||||
if (err) return done(err);
|
|
||||||
assert.equal(1, groups.length);
|
|
||||||
assert.strictEqual('Hidden', groups[0].name);
|
|
||||||
done();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('.isMember()', function() {
|
describe('.isMember()', function() {
|
||||||
|
|||||||
Reference in New Issue
Block a user