Trimmed username spaces (#9793)

This commit is contained in:
Keith Holliday
2018-01-15 10:20:36 -07:00
committed by GitHub
parent 286566fc0c
commit 0ea91016f8
2 changed files with 17 additions and 0 deletions

View File

@@ -37,6 +37,22 @@ describe('POST /user/auth/local/register', () => {
expect(user.newUser).to.eql(true);
});
it('remove spaces from username', async () => {
let username = ' usernamewithspaces ';
let email = 'test@example.com';
let password = 'password';
let user = await api.post('/user/auth/local/register', {
username,
email,
password,
confirmPassword: password,
});
expect(user.auth.local.username).to.eql(username.trim());
expect(user.profile.name).to.eql(username.trim());
});
context('provides default tags and tasks', async () => {
it('for a generic API consumer', async () => {
let username = generateRandomUserName();