mail: require catch all to be absolute
This commit is contained in:
@@ -352,10 +352,19 @@ describe('Mail API', function () {
|
||||
expect(response.statusCode).to.equal(400);
|
||||
});
|
||||
|
||||
it('cannot set with bad addresses field', async function () {
|
||||
const response = await superagent.post(`${serverUrl}/api/v1/mail/${dashboardDomain}/catch_all`)
|
||||
.query({ access_token: owner.token })
|
||||
.send({ addresses: [ 'user1' ] })
|
||||
.ok(() => true);
|
||||
|
||||
expect(response.statusCode).to.equal(400);
|
||||
});
|
||||
|
||||
it('set succeeds', async function () {
|
||||
const response = await superagent.post(`${serverUrl}/api/v1/mail/${dashboardDomain}/catch_all`)
|
||||
.query({ access_token: owner.token })
|
||||
.send({ addresses: [ 'user1' ] });
|
||||
.send({ addresses: [ `user1@${dashboardDomain}` ] });
|
||||
|
||||
expect(response.statusCode).to.equal(202);
|
||||
});
|
||||
@@ -365,7 +374,7 @@ describe('Mail API', function () {
|
||||
.query({ access_token: owner.token });
|
||||
|
||||
expect(response.statusCode).to.equal(200);
|
||||
expect(response.body.catchAll).to.eql([ 'user1' ]);
|
||||
expect(response.body.catchAll).to.eql([ `user1@${dashboardDomain}` ]);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user