fix: spec, remove old tests

v1.18.x
Barış Soner Uşaklı 4 years ago
parent 6e6a7a8f8a
commit 4afdf8bc27

@ -15,6 +15,8 @@ get:
type: array type: array
items: items:
$ref: ../../../components/schemas/UserObject.yaml#/UserObjectACP $ref: ../../../components/schemas/UserObject.yaml#/UserObjectACP
userCount:
type: number
page: page:
type: number type: number
pageCount: pageCount:

@ -255,29 +255,6 @@ describe('Admin Controllers', function () {
}); });
}); });
it('should return 403 if no referer', function (done) {
request(nconf.get('url') + '/api/admin/users/csv', { jar: jar }, function (err, res, body) {
assert.ifError(err);
assert.equal(res.statusCode, 403);
assert.equal(body, '[[error:invalid-origin]]');
done();
});
});
it('should return 403 if referer is not /admin/users/csv', function (done) {
request(nconf.get('url') + '/api/admin/users/csv', {
jar: jar,
headers: {
referer: '/topic/1/test',
},
}, function (err, res, body) {
assert.ifError(err);
assert.equal(res.statusCode, 403);
assert.equal(body, '[[error:invalid-origin]]');
done();
});
});
it('should load /admin/users/csv', function (done) { it('should load /admin/users/csv', function (done) {
request(nconf.get('url') + '/api/admin/users/csv', { request(nconf.get('url') + '/api/admin/users/csv', {
jar: jar, jar: jar,

Loading…
Cancel
Save