fix test on nodev4 remove console.logs

v1.18.x
Barış Soner Uşaklı 8 years ago
parent 90018a7aab
commit 873801e9f3

@ -1,5 +1,6 @@
{
"invalid-data": "Invalid Data",
"invalid-json": "Invalid JSON",
"not-logged-in": "You don't seem to be logged in.",
"account-locked": "Your account has been locked temporarily",

@ -24,7 +24,7 @@ uploadsController.uploadCategoryPicture = function (req, res, next) {
params = JSON.parse(req.body.params);
} catch (e) {
deleteTempFile(uploadedFile.path);
return next(e);
return next(new Error('[[error:invalid-json]]'));
}
if (validateUpload(req, res, next, uploadedFile, allowedImageTypes)) {

@ -176,7 +176,6 @@ describe('Upload Controllers', function () {
it('should fail to upload invalid file type', function (done) {
helpers.uploadFile(nconf.get('url') + '/api/admin/category/uploadpicture', path.join(__dirname, '../test/files/503.html'), { params: JSON.stringify({ cid: cid }) }, jar, csrf_token, function (err, res, body) {
assert.ifError(err);
console.log(body);
assert.equal(body.error, '[[error:invalid-image-type, image/png, image/jpeg, image/pjpeg, image/jpg, image/gif, image/svg+xml]]');
done();
});
@ -185,7 +184,7 @@ describe('Upload Controllers', function () {
it('should fail to upload category image with invalid json params', function (done) {
helpers.uploadFile(nconf.get('url') + '/api/admin/category/uploadpicture', path.join(__dirname, '../test/files/test.png'), { params: 'invalid json' }, jar, csrf_token, function (err, res, body) {
assert.ifError(err);
assert.equal(body.error, 'Unexpected token i in JSON at position 0');
assert.equal(body.error, '[[error:invalid-json]]');
done();
});
});
@ -215,7 +214,6 @@ describe('Upload Controllers', function () {
assert.ifError(err);
assert.equal(res.statusCode, 200);
assert(body);
console.log(body);
done();
});
});

Loading…
Cancel
Save