mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-02-03 05:09:48 +01:00
more tests
This commit is contained in:
@@ -414,6 +414,23 @@ describe('Admin Controllers', function () {
|
||||
});
|
||||
});
|
||||
|
||||
it('/ip-blacklist should 404 for regular user', function (done) {
|
||||
request(nconf.get('url') + '/api/ip-blacklist', { json: true }, function (err, res, body) {
|
||||
assert.ifError(err);
|
||||
assert(body);
|
||||
assert.equal(res.statusCode, 404);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it('should load /ip-blacklist', function (done) {
|
||||
request(nconf.get('url') + '/api/ip-blacklist', { jar: jar, json: true }, function (err, res, body) {
|
||||
assert.ifError(err);
|
||||
assert(body);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it('should load /admin/appearance/themes', function (done) {
|
||||
request(nconf.get('url') + '/api/admin/appearance/themes', { jar: jar, json: true }, function (err, res, body) {
|
||||
assert.ifError(err);
|
||||
|
||||
@@ -218,6 +218,24 @@ describe('Upload Controllers', function () {
|
||||
});
|
||||
});
|
||||
|
||||
it('should upload default avatar', function (done) {
|
||||
helpers.uploadFile(nconf.get('url') + '/api/admin/uploadDefaultAvatar', path.join(__dirname, '../test/files/test.png'), { }, jar, csrf_token, function (err, res, body) {
|
||||
assert.ifError(err);
|
||||
assert.equal(res.statusCode, 200);
|
||||
assert.equal(body[0].url, nconf.get('relative_path') + '/assets/uploads/system/avatar-default.png');
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it('should upload og image', function (done) {
|
||||
helpers.uploadFile(nconf.get('url') + '/api/admin/uploadOgImage', path.join(__dirname, '../test/files/test.png'), { }, jar, csrf_token, function (err, res, body) {
|
||||
assert.ifError(err);
|
||||
assert.equal(res.statusCode, 200);
|
||||
assert.equal(body[0].url, nconf.get('relative_path') + '/assets/uploads/system/og-image.png');
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it('should upload favicon', function (done) {
|
||||
helpers.uploadFile(nconf.get('url') + '/api/admin/uploadfavicon', path.join(__dirname, '../test/files/favicon.ico'), {}, jar, csrf_token, function (err, res, body) {
|
||||
assert.ifError(err);
|
||||
|
||||
Reference in New Issue
Block a user