From 0eac95317075e8004804ece74d96d2a3296fd936 Mon Sep 17 00:00:00 2001 From: Blade Barringer Date: Mon, 26 Oct 2015 08:04:30 -0500 Subject: [PATCH] Adjust stying of put test --- test/api/user/PUT-user.test.js | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) 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'); + }); + }); +});