Allow editing to the same username in the "create username" flow

This commit is contained in:
Chi Vinh Le
2017-06-28 16:08:46 +07:00
parent cb1b9a1463
commit 270491dc0f
3 changed files with 42 additions and 20 deletions
-17
View File
@@ -54,23 +54,6 @@ describe('/api/v1/account/username', () => {
});
});
it('it should return an error when the user submits the same username', (done) => {
chai.request(app)
.post(`/api/v1/users/${mockUser.id}/username-enable`)
.set(passport.inject({id: '456', roles: ['ADMIN']}))
.then(() => chai.request(app)
.put('/api/v1/account/username')
.set(passport.inject({id: mockUser.id, roles: []}))
.send({username: 'Ana'}))
.then(() => {
done(new Error('Expected Error'));
})
.catch((err) => {
expect(err).to.be.ok;
done();
});
});
it('it should return an error when the user tries to edit their username if canEditName is disabled', (done) => {
chai.request(app)
.put('/api/v1/account/username')