0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-10 23:36:14 -05:00

Updated invitations test coverage with more specific checks

refs https://github.com/TryGhost/Ghost/issues/11878

- Updated test cases in preparation to improve messaging in referenced
issue.
This commit is contained in:
Nazar Gargol 2020-09-16 14:24:20 +12:00
parent 80af56b530
commit e9204c9168
3 changed files with 18 additions and 3 deletions

View file

@ -301,7 +301,12 @@ describe('Authentication API v3', function () {
})
.expect('Content-Type', /json/)
.expect('Cache-Control', testUtils.cacheRules.private)
.expect(401);
.expect(401)
.then((res) => {
should.exist(res.body.errors);
res.body.errors[0].type.should.eql('UnauthorizedError');
res.body.errors[0].message.should.eql('Invalid token structure');
});
});
it('reset password: generate reset token', function () {

View file

@ -409,7 +409,12 @@ describe('Authentication API v2', function () {
})
.expect('Content-Type', /json/)
.expect('Cache-Control', testUtils.cacheRules.private)
.expect(401);
.expect(401)
.then((res) => {
should.exist(res.body.errors);
res.body.errors[0].type.should.eql('UnauthorizedError');
res.body.errors[0].message.should.eql('Invalid token structure');
});
});
it('reset password: generate reset token', function () {

View file

@ -285,7 +285,12 @@ describe('Authentication API v3', function () {
})
.expect('Content-Type', /json/)
.expect('Cache-Control', testUtils.cacheRules.private)
.expect(401);
.expect(401)
.then((res) => {
should.exist(res.body.errors);
res.body.errors[0].type.should.eql('UnauthorizedError');
res.body.errors[0].message.should.eql('Invalid token structure');
});
});
it('reset password: generate reset token', function () {