Skip to content

Node.js based forum software built for the modern web

fix(writeapi): tests

Julian Lam229eb2c2d800
diff --git a/test/controllers.js b/test/controllers.js
index 8636b7844d..d7573ba405 100644
--- a/test/controllers.js
+++ b/test/controllers.js
@@ -822,9 +822,11 @@ describe('Controllers', function () {
assert.ifError(err);
assert.equal(res.statusCode, 403);
assert.deepEqual(JSON.parse(body), {
- path: '/user/doesnotexist/session/1112233',
- loggedIn: true,
- title: '[[global:403.title]]',
+ response: {},
+ status: {
+ code: 'forbidden',
+ message: 'You are not authorised to make this call',
+ },
});
done();
});
@@ -1340,7 +1342,13 @@ describe('Controllers', function () {
request(nconf.get('url') + '/api/user/foo', { json: true }, function (err, res, body) {
assert.ifError(err);
assert.equal(res.statusCode, 401);
- assert.equal(body, 'not-authorized');
+ assert.deepEqual(body, {
+ response: {},
+ status: {
+ code: 'not-authorised',
+ message: 'A valid login session was not found. Please log in and try again.',
+ },
+ });
privileges.global.give(['groups:view:users'], 'guests', done);
});
});