mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-10 23:36:14 -05:00
Added missing test coverage for "setupUpdate" method
This commit is contained in:
parent
4441ee15a0
commit
67c2fb8285
1 changed files with 33 additions and 0 deletions
|
@ -366,6 +366,39 @@ describe('Authentication API', function () {
|
||||||
.expect('Content-Type', /json/)
|
.expect('Content-Type', /json/)
|
||||||
.expect(403);
|
.expect(403);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('update setup', function () {
|
||||||
|
return localUtils.doAuth(request)
|
||||||
|
.then((ownerAccessToken) => {
|
||||||
|
return request
|
||||||
|
.put(localUtils.API.getApiQuery('authentication/setup'))
|
||||||
|
.set('Authorization', 'Bearer ' + ownerAccessToken)
|
||||||
|
.set('Origin', config.get('url'))
|
||||||
|
.send({
|
||||||
|
setup: [{
|
||||||
|
name: 'test user edit',
|
||||||
|
email: 'test-edited@example.com',
|
||||||
|
password: 'thisissupersafe',
|
||||||
|
blogTitle: 'a test blog'
|
||||||
|
}]
|
||||||
|
})
|
||||||
|
.expect('Content-Type', /json/)
|
||||||
|
.expect(200);
|
||||||
|
})
|
||||||
|
.then((res) => {
|
||||||
|
const jsonResponse = res.body;
|
||||||
|
should.exist(jsonResponse.users);
|
||||||
|
should.not.exist(jsonResponse.meta);
|
||||||
|
|
||||||
|
jsonResponse.users.should.have.length(1);
|
||||||
|
localUtils.API.checkResponse(jsonResponse.users[0], 'user');
|
||||||
|
|
||||||
|
const newUser = jsonResponse.users[0];
|
||||||
|
newUser.id.should.equal(testUtils.DataGenerator.Content.users[0].id);
|
||||||
|
newUser.name.should.equal('test user edit');
|
||||||
|
newUser.email.should.equal('test-edited@example.com');
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('Invitation', function () {
|
describe('Invitation', function () {
|
||||||
|
|
Loading…
Add table
Reference in a new issue