mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-01 11:35:55 +01:00
change test so it checks url
This commit is contained in:
@@ -125,11 +125,7 @@ function resizeImage(fileObj, callback) {
|
|||||||
},
|
},
|
||||||
function (next) {
|
function (next) {
|
||||||
// Return the resized version to the composer/postData
|
// Return the resized version to the composer/postData
|
||||||
var dirname = path.dirname(fileObj.url);
|
fileObj.url = file.appendToFileName(fileObj.url, '-resized');
|
||||||
var extname = path.extname(fileObj.url);
|
|
||||||
var basename = path.basename(fileObj.url, extname);
|
|
||||||
|
|
||||||
fileObj.url = dirname + '/' + basename + '-resized' + extname;
|
|
||||||
|
|
||||||
next(null, fileObj);
|
next(null, fileObj);
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -115,6 +115,7 @@ describe('Upload Controllers', function () {
|
|||||||
assert.equal(res.statusCode, 200);
|
assert.equal(res.statusCode, 200);
|
||||||
assert(Array.isArray(body));
|
assert(Array.isArray(body));
|
||||||
assert(body[0].url);
|
assert(body[0].url);
|
||||||
|
assert(body[0].url.match(/\/assets\/uploads\/files\/\d+-test-resized\.png/));
|
||||||
meta.config.maximumImageWidth = oldValue;
|
meta.config.maximumImageWidth = oldValue;
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user