Move api tests to v2 namespace

This commit is contained in:
Blade Barringer
2015-11-03 08:31:20 -06:00
parent 2713b0f26f
commit 8c95de0835
30 changed files with 42 additions and 38 deletions

View File

@@ -0,0 +1,33 @@
import {
generateUser,
requester,
} from '../../../helpers/api-integration.helper';
describe('GET /user', () => {
let user;
before(() => {
return generateUser().then((usr) => {
let api = requester(usr);
return api.get('/user');
}).then((fetchedUser) => {
user = fetchedUser;
});
});
it('gets the user object', () => {
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);
});
it('does not include password information', () => {
expect(user.auth.local.hashed_password).to.not.exist
expect(user.auth.local.salt).to.not.exist
});
it('does not include api token', () => {
expect(user.apiToken).to.not.exist
});
});