2015-10-17 23:27:19 +00:00
|
|
|
import {
|
|
|
|
|
generateUser,
|
2015-11-03 14:31:20 +00:00
|
|
|
} from '../../../helpers/api-integration.helper';
|
2015-10-17 23:27:19 +00:00
|
|
|
|
|
|
|
|
describe('GET /user', () => {
|
2015-10-25 13:14:16 +00:00
|
|
|
let user;
|
2015-10-17 23:27:19 +00:00
|
|
|
|
2016-01-01 18:56:43 +00:00
|
|
|
before(async () => {
|
2015-12-31 18:11:40 +00:00
|
|
|
let usr = await generateUser();
|
|
|
|
|
user = await usr.get('/user');
|
2015-10-17 23:27:19 +00:00
|
|
|
});
|
|
|
|
|
|
2016-01-01 16:32:28 +00:00
|
|
|
it('gets the user object', async () => {
|
2015-10-29 02:06:28 +00:00
|
|
|
expect(user._id).to.eql(user._id);
|
|
|
|
|
expect(user.auth.local.username).to.eql(user.auth.local.username);
|
|
|
|
|
expect(user.todos).to.eql(user.todos);
|
|
|
|
|
expect(user.items).to.eql(user.items);
|
|
|
|
|
});
|
|
|
|
|
|
2016-01-01 16:32:28 +00:00
|
|
|
it('does not include password information', async () => {
|
2016-01-03 00:28:06 +00:00
|
|
|
expect(user.auth.local.hashed_password).to.not.exist;
|
|
|
|
|
expect(user.auth.local.salt).to.not.exist;
|
2015-10-29 02:06:28 +00:00
|
|
|
});
|
|
|
|
|
|
2016-01-01 16:32:28 +00:00
|
|
|
it('does not include api token', async () => {
|
2016-01-03 00:28:06 +00:00
|
|
|
expect(user.apiToken).to.not.exist;
|
2015-10-17 23:27:19 +00:00
|
|
|
});
|
|
|
|
|
});
|