mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-10 23:36:14 -05:00
Fixed regression tests that had to do with new error format
refs #10438
This commit is contained in:
parent
d6872de0b2
commit
4d15b25153
4 changed files with 56 additions and 8 deletions
|
@ -104,7 +104,7 @@ describe('DB API', () => {
|
||||||
.expect(403)
|
.expect(403)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
should.exist(res.body.errors);
|
should.exist(res.body.errors);
|
||||||
res.body.errors[0].errorType.should.eql('NoPermissionError');
|
res.body.errors[0].type.should.eql('NoPermissionError');
|
||||||
fsStub.called.should.eql(false);
|
fsStub.called.should.eql(false);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -118,7 +118,7 @@ describe('DB API', () => {
|
||||||
.expect(401)
|
.expect(401)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
should.exist(res.body.errors);
|
should.exist(res.body.errors);
|
||||||
res.body.errors[0].errorType.should.eql('UnauthorizedError');
|
res.body.errors[0].type.should.eql('UnauthorizedError');
|
||||||
fsStub.called.should.eql(false);
|
fsStub.called.should.eql(false);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -108,7 +108,15 @@ describe('Posts API', function () {
|
||||||
var jsonResponse = res.body;
|
var jsonResponse = res.body;
|
||||||
should.exist(jsonResponse);
|
should.exist(jsonResponse);
|
||||||
should.exist(jsonResponse.errors);
|
should.exist(jsonResponse.errors);
|
||||||
testUtils.API.checkResponseValue(jsonResponse.errors[0], ['message', 'errorType']);
|
testUtils.API.checkResponseValue(jsonResponse.errors[0], [
|
||||||
|
'message',
|
||||||
|
'context',
|
||||||
|
'type',
|
||||||
|
'details',
|
||||||
|
'help',
|
||||||
|
'code',
|
||||||
|
'id'
|
||||||
|
]);
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -190,7 +198,15 @@ describe('Posts API', function () {
|
||||||
should.not.exist(res.headers['x-cache-invalidate']);
|
should.not.exist(res.headers['x-cache-invalidate']);
|
||||||
should.exist(res.body);
|
should.exist(res.body);
|
||||||
should.exist(res.body.errors);
|
should.exist(res.body.errors);
|
||||||
testUtils.API.checkResponseValue(res.body.errors[0], ['message', 'errorType']);
|
testUtils.API.checkResponseValue(res.body.errors[0], [
|
||||||
|
'message',
|
||||||
|
'context',
|
||||||
|
'type',
|
||||||
|
'details',
|
||||||
|
'help',
|
||||||
|
'code',
|
||||||
|
'id'
|
||||||
|
]);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -64,7 +64,15 @@ describe('Settings API', function () {
|
||||||
var jsonResponse = res.body;
|
var jsonResponse = res.body;
|
||||||
should.exist(jsonResponse);
|
should.exist(jsonResponse);
|
||||||
should.exist(jsonResponse.errors);
|
should.exist(jsonResponse.errors);
|
||||||
testUtils.API.checkResponseValue(jsonResponse.errors[0], ['message', 'errorType']);
|
testUtils.API.checkResponseValue(jsonResponse.errors[0], [
|
||||||
|
'message',
|
||||||
|
'context',
|
||||||
|
'type',
|
||||||
|
'details',
|
||||||
|
'help',
|
||||||
|
'code',
|
||||||
|
'id'
|
||||||
|
]);
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -120,7 +128,15 @@ describe('Settings API', function () {
|
||||||
jsonResponse = res.body;
|
jsonResponse = res.body;
|
||||||
should.not.exist(res.headers['x-cache-invalidate']);
|
should.not.exist(res.headers['x-cache-invalidate']);
|
||||||
should.exist(jsonResponse.errors);
|
should.exist(jsonResponse.errors);
|
||||||
testUtils.API.checkResponseValue(jsonResponse.errors[0], ['message', 'errorType']);
|
testUtils.API.checkResponseValue(jsonResponse.errors[0], [
|
||||||
|
'message',
|
||||||
|
'context',
|
||||||
|
'type',
|
||||||
|
'details',
|
||||||
|
'help',
|
||||||
|
'code',
|
||||||
|
'id'
|
||||||
|
]);
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -58,7 +58,15 @@ describe('User API', function () {
|
||||||
var jsonResponse = res.body;
|
var jsonResponse = res.body;
|
||||||
should.exist(jsonResponse);
|
should.exist(jsonResponse);
|
||||||
should.exist(jsonResponse.errors);
|
should.exist(jsonResponse.errors);
|
||||||
testUtils.API.checkResponseValue(jsonResponse.errors[0], ['message', 'errorType']);
|
testUtils.API.checkResponseValue(jsonResponse.errors[0], [
|
||||||
|
'message',
|
||||||
|
'context',
|
||||||
|
'type',
|
||||||
|
'details',
|
||||||
|
'help',
|
||||||
|
'code',
|
||||||
|
'id'
|
||||||
|
]);
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -79,7 +87,15 @@ describe('User API', function () {
|
||||||
var jsonResponse = res.body;
|
var jsonResponse = res.body;
|
||||||
should.exist(jsonResponse);
|
should.exist(jsonResponse);
|
||||||
should.exist(jsonResponse.errors);
|
should.exist(jsonResponse.errors);
|
||||||
testUtils.API.checkResponseValue(jsonResponse.errors[0], ['message', 'errorType']);
|
testUtils.API.checkResponseValue(jsonResponse.errors[0], [
|
||||||
|
'message',
|
||||||
|
'context',
|
||||||
|
'type',
|
||||||
|
'details',
|
||||||
|
'help',
|
||||||
|
'code',
|
||||||
|
'id'
|
||||||
|
]);
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Reference in a new issue