mirror of
				https://github.com/NodeBB/NodeBB.git
				synced 2025-10-31 19:15:58 +01:00 
			
		
		
		
	fix(writeapi): tests
This commit is contained in:
		| @@ -822,9 +822,11 @@ describe('Controllers', function () { | |||||||
| 				assert.ifError(err); | 				assert.ifError(err); | ||||||
| 				assert.equal(res.statusCode, 403); | 				assert.equal(res.statusCode, 403); | ||||||
| 				assert.deepEqual(JSON.parse(body), { | 				assert.deepEqual(JSON.parse(body), { | ||||||
| 					path: '/user/doesnotexist/session/1112233', | 					response: {}, | ||||||
| 					loggedIn: true, | 					status: { | ||||||
| 					title: '[[global:403.title]]', | 						code: 'forbidden', | ||||||
|  | 						message: 'You are not authorised to make this call', | ||||||
|  | 					}, | ||||||
| 				}); | 				}); | ||||||
| 				done(); | 				done(); | ||||||
| 			}); | 			}); | ||||||
| @@ -1340,7 +1342,13 @@ describe('Controllers', function () { | |||||||
| 				request(nconf.get('url') + '/api/user/foo', { json: true }, function (err, res, body) { | 				request(nconf.get('url') + '/api/user/foo', { json: true }, function (err, res, body) { | ||||||
| 					assert.ifError(err); | 					assert.ifError(err); | ||||||
| 					assert.equal(res.statusCode, 401); | 					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); | 					privileges.global.give(['groups:view:users'], 'guests', done); | ||||||
| 				}); | 				}); | ||||||
| 			}); | 			}); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user