Creates initial PUT /user test

Adds missing semi-colon to DELETE-user.test.js
This commit is contained in:
Jeremy Abbott
2015-10-21 20:08:16 -05:00
parent 01914523e1
commit e4269723e1
2 changed files with 28 additions and 1 deletions

View File

@@ -9,7 +9,7 @@ describe('DELETE /user', () => {
beforeEach(() => { beforeEach(() => {
return generateUser().then((user) => { return generateUser().then((user) => {
api = requester(user); api = requester(user);
}) });
}); });
it('deletes the user', () => { it('deletes the user', () => {

View File

@@ -0,0 +1,27 @@
import {
generateUser,
requester,
} from '../../helpers/api.helper';
describe('PUT /user', () => {
let api, user;
beforeEach((done) => {
return generateUser().then((usr) => {
user = usr;
api = requester(usr);
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');
});
});
});