tests(api): Convert tests to use new api user methods

This commit is contained in:
Blade Barringer
2015-12-29 17:34:33 -06:00
parent b2336c7adf
commit 4cf9518a5a
28 changed files with 213 additions and 313 deletions

View File

@@ -1,23 +1,23 @@
import {
generateUser,
requester,
} from '../../../../helpers/api-integration.helper';
describe('POST /user/pushDevice', () => {
let api;
let user;
beforeEach(() => {
return generateUser().then((user) => {
api = requester(user);
return generateUser().then((_user) => {
user = _user;
});
});
it('registers a device id', () => {
return api.post('/user/pushDevice', {
return user.post('/user/pushDevice', {
regId: '123123',
type: 'android',
}).then((devices) => {
let device = devices[0];
expect(device._id).to.exist;
expect(device.regId).to.eql('123123');
expect(device.type).to.eql('android');