Adjust the get user integration test

This commit is contained in:
Blade Barringer
2015-10-25 08:14:16 -05:00
parent 600f56dae0
commit 69d48cb98e

View File

@@ -4,25 +4,22 @@ import {
} from '../../helpers/api.helper'; } from '../../helpers/api.helper';
describe('GET /user', () => { describe('GET /user', () => {
let api, user; let user;
beforeEach((done) => { beforeEach(() => {
generateUser().then((usr) => { return generateUser().then((usr) => {
user = usr; user = usr;
api = requester(usr); });
done();
}).catch(done);
}); });
it('gets the user object', (done) => { it('gets the user object', (done) => {
api.get('/user') let api = requester(user);
.then((fetchedUser) => { api.get('/user').then((fetchedUser) => {
expect(fetchedUser._id).to.eql(user._id); expect(fetchedUser._id).to.eql(user._id);
expect(fetchedUser.auth.local.username).to.eql(user.auth.local.username);
expect(fetchedUser.todos).to.eql(user.todos); expect(fetchedUser.todos).to.eql(user.todos);
expect(fetchedUser.items).to.eql(user.items);
done(); done();
})
.catch((err) => {
done(err);
}); });
}); });
}); });