fallbackEmail is now independent from email
This commit is contained in:
@@ -76,6 +76,15 @@ describe('Users API', function () {
|
||||
expect(response.statusCode).to.equal(400);
|
||||
});
|
||||
|
||||
it('cannot create user with non email fallbackEmail', async function () {
|
||||
const response = await superagent.post(`${serverUrl}/api/v1/users`)
|
||||
.query({ access_token: owner.token })
|
||||
.send({ username: user2.username, email: user2.email, fallbackEmail: 'notanemail' })
|
||||
.ok(() => true);
|
||||
|
||||
expect(response.statusCode).to.equal(400);
|
||||
});
|
||||
|
||||
it('create second user succeeds', async function () {
|
||||
const response = await superagent.post(`${serverUrl}/api/v1/users`)
|
||||
.query({ access_token: owner.token })
|
||||
@@ -299,6 +308,15 @@ describe('Users API', function () {
|
||||
expect(response.statusCode).to.equal(400);
|
||||
});
|
||||
|
||||
it('change fallbackEmail fails due to invalid email', async function () {
|
||||
const response = await superagent.post(`${serverUrl}/api/v1/users/${user2.id}`)
|
||||
.query({ access_token: owner.token })
|
||||
.send({ fallbackEmail: 'newemail@cloudron' })
|
||||
.ok(() => true);
|
||||
|
||||
expect(response.statusCode).to.equal(400);
|
||||
});
|
||||
|
||||
it('change user succeeds without email nor displayName', async function () {
|
||||
const response = await superagent.post(`${serverUrl}/api/v1/users/${user2.id}`)
|
||||
.query({ access_token: owner.token })
|
||||
|
||||
Reference in New Issue
Block a user