remove dupe meta

v1.18.x
Barış Soner Uşaklı 7 years ago
parent d998d53902
commit 8810f0f2a9

@ -10,7 +10,6 @@ var db = require('./mocks/databasemock');
var User = require('../src/user'); var User = require('../src/user');
var Topics = require('../src/topics'); var Topics = require('../src/topics');
var Categories = require('../src/categories'); var Categories = require('../src/categories');
var Meta = require('../src/meta');
var Password = require('../src/password'); var Password = require('../src/password');
var groups = require('../src/groups'); var groups = require('../src/groups');
var helpers = require('./helpers'); var helpers = require('./helpers');
@ -202,8 +201,8 @@ describe('User', function () {
describe('.isReadyToPost()', function () { describe('.isReadyToPost()', function () {
it('should error when a user makes two posts in quick succession', function (done) { it('should error when a user makes two posts in quick succession', function (done) {
Meta.config = Meta.config || {}; meta.config = meta.config || {};
Meta.config.postDelay = '10'; meta.config.postDelay = '10';
async.series([ async.series([
async.apply(Topics.post, { async.apply(Topics.post, {
@ -239,8 +238,8 @@ describe('User', function () {
}); });
it('should error when a new user posts if the last post time is 10 < 30 seconds', function (done) { it('should error when a new user posts if the last post time is 10 < 30 seconds', function (done) {
Meta.config.newbiePostDelay = 30; meta.config.newbiePostDelay = 30;
Meta.config.newbiePostDelayThreshold = 3; meta.config.newbiePostDelayThreshold = 3;
User.setUserField(testUid, 'lastposttime', +new Date() - (20 * 1000), function () { User.setUserField(testUid, 'lastposttime', +new Date() - (20 * 1000), function () {
Topics.post({ Topics.post({
@ -292,10 +291,10 @@ describe('User', function () {
}); });
it('should error for guest', function (done) { it('should error for guest', function (done) {
Meta.config.allowGuestUserSearching = 0; meta.config.allowGuestUserSearching = 0;
socketUser.search({ uid: 0 }, { query: 'john' }, function (err) { socketUser.search({ uid: 0 }, { query: 'john' }, function (err) {
assert.equal(err.message, '[[error:not-logged-in]]'); assert.equal(err.message, '[[error:not-logged-in]]');
Meta.config.allowGuestUserSearching = 1; meta.config.allowGuestUserSearching = 1;
done(); done();
}); });
}); });
@ -1145,10 +1144,10 @@ describe('User', function () {
}); });
it('should send email confirm', function (done) { it('should send email confirm', function (done) {
Meta.config.requireEmailConfirmation = 1; meta.config.requireEmailConfirmation = 1;
socketUser.emailConfirm({ uid: testUid }, {}, function (err) { socketUser.emailConfirm({ uid: testUid }, {}, function (err) {
assert.ifError(err); assert.ifError(err);
Meta.config.requireEmailConfirmation = 0; meta.config.requireEmailConfirmation = 0;
done(); done();
}); });
}); });
@ -1258,8 +1257,8 @@ describe('User', function () {
var oldRegistrationType; var oldRegistrationType;
var adminUid; var adminUid;
before(function (done) { before(function (done) {
oldRegistrationType = Meta.config.registrationType; oldRegistrationType = meta.config.registrationType;
Meta.config.registrationType = 'admin-approval'; meta.config.registrationType = 'admin-approval';
User.create({ username: 'admin', password: '123456' }, function (err, uid) { User.create({ username: 'admin', password: '123456' }, function (err, uid) {
assert.ifError(err); assert.ifError(err);
adminUid = uid; adminUid = uid;
@ -1268,7 +1267,7 @@ describe('User', function () {
}); });
after(function (done) { after(function (done) {
Meta.config.registrationType = oldRegistrationType; meta.config.registrationType = oldRegistrationType;
done(); done();
}); });

Loading…
Cancel
Save