mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-02-25 16:11:19 +01:00
closes #6284
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -29,6 +29,7 @@ pidfile
|
||||
|
||||
/public/sounds
|
||||
/public/uploads
|
||||
/test/uploads
|
||||
|
||||
# compiled files
|
||||
/public/stylesheet.css
|
||||
|
||||
@@ -17,7 +17,7 @@ nconf.file({ file: path.join(__dirname, '../../config.json') });
|
||||
nconf.defaults({
|
||||
base_dir: path.join(__dirname, '../..'),
|
||||
themes_path: path.join(__dirname, '../../node_modules'),
|
||||
upload_path: 'public/uploads',
|
||||
upload_path: 'test/uploads',
|
||||
views_dir: path.join(__dirname, '../../build/public/templates'),
|
||||
relative_path: '',
|
||||
});
|
||||
@@ -173,6 +173,21 @@ function setupMockDefaults(callback) {
|
||||
id: 'nodebb-theme-persona',
|
||||
}, next);
|
||||
},
|
||||
function (next) {
|
||||
var rimraf = require('rimraf');
|
||||
rimraf('test/uploads', next);
|
||||
},
|
||||
function (next) {
|
||||
var mkdirp = require('mkdirp');
|
||||
async.eachSeries([
|
||||
'test/uploads',
|
||||
'test/uploads/category',
|
||||
'test/uploads/files',
|
||||
'test/uploads/system',
|
||||
'test/uploads/sounds',
|
||||
'test/uploads/profile',
|
||||
], mkdirp, next);
|
||||
},
|
||||
], callback);
|
||||
}
|
||||
db.setupMockDefaults = setupMockDefaults;
|
||||
|
||||
@@ -816,7 +816,7 @@ describe('User', function () {
|
||||
}, function (err, uploadedPicture) {
|
||||
assert.ifError(err);
|
||||
assert.equal(uploadedPicture.url, '/assets/uploads/profile/' + uid + '-profileavatar.png');
|
||||
assert.equal(uploadedPicture.path, path.join(nconf.get('base_dir'), 'public', 'uploads', 'profile', uid + '-profileavatar.png'));
|
||||
assert.equal(uploadedPicture.path, path.join(nconf.get('upload_path'), 'profile', uid + '-profileavatar.png'));
|
||||
done();
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user