From 3bf7faf5fce5d0f20cc7839f149476442fcca3ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Mon, 20 Nov 2017 19:58:46 -0500 Subject: [PATCH] increase rate limit delay --- test/messaging.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/messaging.js b/test/messaging.js index c2d7ee1b67..29d381658b 100644 --- a/test/messaging.js +++ b/test/messaging.js @@ -90,10 +90,13 @@ describe('Messaging Library', function () { it('should return rate limit error on second try', function (done) { var socketMock = { uid: fooUid }; + var oldValue = meta.config.chatMessageDelay; + meta.config.chatMessageDelay = 1000; socketModules.chats.newRoom(socketMock, { touid: bazUid }, function (err) { assert.ifError(err); socketModules.chats.newRoom(socketMock, { touid: bazUid }, function (err) { assert.equal(err.message, '[[error:too-many-messages]]'); + meta.configs.chatMessageDelay = oldValue; done(); }); }); @@ -250,10 +253,13 @@ describe('Messaging Library', function () { it('should fail to send second message due to rate limit', function (done) { var socketMock = { uid: fooUid }; + var oldValue = meta.config.chatMessageDelay; + meta.config.chatMessageDelay = 1000; socketModules.chats.send(socketMock, { roomId: roomId, message: 'first chat message' }, function (err) { assert.ifError(err); socketModules.chats.send(socketMock, { roomId: roomId, message: 'first chat message' }, function (err) { assert.equal(err.message, '[[error:too-many-messages]]'); + meta.config.chatMessageDelay = oldValue; done(); }); });