From df2c7851272f56ec119141f6c7668550fda4cf5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Fri, 24 Jan 2020 15:24:01 -0500 Subject: [PATCH] feat: add test for change post owner --- test/posts.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/posts.js b/test/posts.js index adcc4a7ec2..dc82563463 100644 --- a/test/posts.js +++ b/test/posts.js @@ -142,6 +142,14 @@ describe('Post\'s', function () { } }); + it('should fail to change owner if user is not authorized', async function () { + try { + await socketPosts.changeOwner({ uid: voterUid }, { pids: [1, 2], toUid: voterUid }); + } catch (err) { + assert.strictEqual(err.message, '[[error:no-privileges]]'); + } + }); + it('should return falsy if post does not exist', function (done) { posts.getPostData(9999, function (err, postData) { assert.ifError(err);