From 8810f0f2a940d94b3a53c865c27c7f94904eaca3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Thu, 2 Nov 2017 14:55:05 -0400 Subject: [PATCH] remove dupe meta --- test/user.js | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/test/user.js b/test/user.js index c93917747b..d37e55e485 100644 --- a/test/user.js +++ b/test/user.js @@ -10,7 +10,6 @@ var db = require('./mocks/databasemock'); var User = require('../src/user'); var Topics = require('../src/topics'); var Categories = require('../src/categories'); -var Meta = require('../src/meta'); var Password = require('../src/password'); var groups = require('../src/groups'); var helpers = require('./helpers'); @@ -202,8 +201,8 @@ describe('User', function () { describe('.isReadyToPost()', function () { it('should error when a user makes two posts in quick succession', function (done) { - Meta.config = Meta.config || {}; - Meta.config.postDelay = '10'; + meta.config = meta.config || {}; + meta.config.postDelay = '10'; async.series([ 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) { - Meta.config.newbiePostDelay = 30; - Meta.config.newbiePostDelayThreshold = 3; + meta.config.newbiePostDelay = 30; + meta.config.newbiePostDelayThreshold = 3; User.setUserField(testUid, 'lastposttime', +new Date() - (20 * 1000), function () { Topics.post({ @@ -292,10 +291,10 @@ describe('User', function () { }); it('should error for guest', function (done) { - Meta.config.allowGuestUserSearching = 0; + meta.config.allowGuestUserSearching = 0; socketUser.search({ uid: 0 }, { query: 'john' }, function (err) { assert.equal(err.message, '[[error:not-logged-in]]'); - Meta.config.allowGuestUserSearching = 1; + meta.config.allowGuestUserSearching = 1; done(); }); }); @@ -1145,10 +1144,10 @@ describe('User', function () { }); it('should send email confirm', function (done) { - Meta.config.requireEmailConfirmation = 1; + meta.config.requireEmailConfirmation = 1; socketUser.emailConfirm({ uid: testUid }, {}, function (err) { assert.ifError(err); - Meta.config.requireEmailConfirmation = 0; + meta.config.requireEmailConfirmation = 0; done(); }); }); @@ -1258,8 +1257,8 @@ describe('User', function () { var oldRegistrationType; var adminUid; before(function (done) { - oldRegistrationType = Meta.config.registrationType; - Meta.config.registrationType = 'admin-approval'; + oldRegistrationType = meta.config.registrationType; + meta.config.registrationType = 'admin-approval'; User.create({ username: 'admin', password: '123456' }, function (err, uid) { assert.ifError(err); adminUid = uid; @@ -1268,7 +1267,7 @@ describe('User', function () { }); after(function (done) { - Meta.config.registrationType = oldRegistrationType; + meta.config.registrationType = oldRegistrationType; done(); });