Adjust delete route test to use promises

This commit is contained in:
Blade Barringer
2015-10-25 08:16:21 -05:00
parent 69d48cb98e
commit 27cb5881cd

View File

@@ -6,25 +6,16 @@ import {
describe('DELETE /user', () => {
let api;
beforeEach((done) => {
generateUser().then((usr) => {
api = requester(usr);
done();
}).catch(done);
beforeEach(() => {
return generateUser().then((user) => {
api = requester(user);
})
});
it('deletes the user', (done) => {
api.del('/user')
.then((fetchedUser) => {
it('deletes the user', () => {
return expect(api.del('/user').then((fetchedUser) => {
return api.get('/user');
})
.then((deletedUser) => {
done('Unexpected user');
})
.catch((err) => {
expect(err).to.eql('No user found.');
done();
});
})).to.be.rejectedWith('No user found.');
});
context('user in solo group', () => {