Update invite route tests
This commit is contained in:
@@ -173,8 +173,8 @@ describe('Users API', function () {
|
||||
});
|
||||
|
||||
describe('invite', function () {
|
||||
it(' unknown user fails', async function () {
|
||||
const response = await superagent.post(`${serverUrl}/api/v1/users/randomuserid/create_invite`)
|
||||
it('creationg fails for unknown user', async function () {
|
||||
const response = await superagent.get(`${serverUrl}/api/v1/users/randomuserid/invite_link`)
|
||||
.query({ access_token: owner.token })
|
||||
.send({})
|
||||
.ok(() => true);
|
||||
@@ -182,6 +182,16 @@ describe('Users API', function () {
|
||||
expect(response.statusCode).to.equal(404);
|
||||
});
|
||||
|
||||
it('creation succeeds', async function () {
|
||||
const response = await superagent.get(`${serverUrl}/api/v1/users/${user.id}/invite_link`)
|
||||
.query({ access_token: owner.token })
|
||||
.send({})
|
||||
.ok(() => true);
|
||||
|
||||
expect(response.statusCode).to.equal(200);
|
||||
expect(response.body.inviteLink).to.be.a('string');
|
||||
});
|
||||
|
||||
it('sending succeeds', async function () {
|
||||
common.clearMailQueue();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user