From e3c9dafa08c249b057b494ee7bf61cbb7785a024 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Fri, 1 Nov 2019 22:13:00 -0400 Subject: [PATCH] fix: tests --- test/controllers.js | 2 +- test/messaging.js | 2 +- test/notifications.js | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/test/controllers.js b/test/controllers.js index 649f077156..9c14d42b72 100644 --- a/test/controllers.js +++ b/test/controllers.js @@ -1300,7 +1300,7 @@ describe('Controllers', function () { assert.equal(notif.bodyShort, notifData.bodyShort); assert.equal(notif.bodyLong, notifData.bodyLong); assert.equal(notif.pid, notifData.pid); - assert.equal(notif.path, notifData.path); + assert.equal(notif.path, nconf.get('relative_path') + notifData.path); assert.equal(notif.nid, notifData.nid); next(); }, diff --git a/test/messaging.js b/test/messaging.js index 4188e7e50b..c49c6d6ee5 100644 --- a/test/messaging.js +++ b/test/messaging.js @@ -382,7 +382,7 @@ describe('Messaging Library', function () { var notification = data.unread[0]; assert.equal(notification.bodyShort, '[[notifications:new_message_from, foo]]'); assert.equal(notification.nid, 'chat_' + fooUid + '_' + roomId); - assert.equal(notification.path, '/chats/' + roomId); + assert.equal(notification.path, nconf.get('relative_path') + '/chats/' + roomId); done(); }); }, 1500); diff --git a/test/notifications.js b/test/notifications.js index 73af314fa9..5cca226e02 100644 --- a/test/notifications.js +++ b/test/notifications.js @@ -3,6 +3,7 @@ var assert = require('assert'); var async = require('async'); +var nconf = require('nconf'); var db = require('./mocks/databasemock'); var meta = require('../src/meta'); @@ -228,7 +229,6 @@ describe('Notifications', function () { it('should link to the first unread post in a watched topic', function (done) { var categories = require('../src/categories'); var topics = require('../src/topics'); - var watcherUid; var cid; var tid; @@ -286,7 +286,7 @@ describe('Notifications', function () { }, function (notifications, next) { assert.equal(notifications.unread.length, 1, 'there should be 1 unread notification'); - assert.equal('/post/' + pid, notifications.unread[0].path, 'the notification should link to the first unread post'); + assert.equal(nconf.get('relative_path') + '/post/' + pid, notifications.unread[0].path, 'the notification should link to the first unread post'); next(); }, ], function (err) { @@ -300,7 +300,7 @@ describe('Notifications', function () { assert.ifError(err); assert.equal(data[0].bodyShort, 'bodyShort'); assert.equal(data[0].nid, 'notification_id'); - assert.equal(data[0].path, '/notification/path'); + assert.equal(data[0].path, nconf.get('relative_path') + '/notification/path'); done(); }); });