diff --git a/test/api/user/PUT-user.test.js b/test/api/user/PUT-user.test.js index 9fdc600e86..b697e2f5b2 100644 --- a/test/api/user/PUT-user.test.js +++ b/test/api/user/PUT-user.test.js @@ -5,23 +5,19 @@ import { describe('PUT /user', () => { let api, user; - - beforeEach((done) => { - generateUser().then((usr) => { + + beforeEach(() => { + return generateUser().then((usr) => { user = usr; - api = requester(usr); - done(); - }).catch(done); - }); - - it("updates the user", () => { - let api = requester(user); - return api.get('/user') - .then((fetchedUser) => { - return api.put("/user", {"profile.name" : "Frodo"}); - }) - .then((updatedUser) => { - expect(updatedUser.profile.name).to.eql("Frodo"); + api = requester(user); }); }); -}); \ No newline at end of file + + it('updates the user', () => { + return api.put('/user', { + 'profile.name' : 'Frodo', + }).then((updatedUser) => { + expect(updatedUser.profile.name).to.eql('Frodo'); + }); + }); +});