tests(api): Add sync method to api objects

This commit is contained in:
Blade Barringer
2016-01-16 21:50:54 -06:00
parent 87d4c68bea
commit 96f6bbfb0c
6 changed files with 45 additions and 20 deletions

View File

@@ -14,15 +14,17 @@ describe('PUT /user', () => {
context('Allowed Operations', () => {
it('updates the user', async () => {
let updatedUser = await user.put('/user', {
await user.put('/user', {
'profile.name': 'Frodo',
'preferences.costume': true,
'stats.hp': 14,
});
expect(updatedUser.profile.name).to.eql('Frodo');
expect(updatedUser.preferences.costume).to.eql(true);
expect(updatedUser.stats.hp).to.eql(14);
await user.sync();
expect(user.profile.name).to.eql('Frodo');
expect(user.preferences.costume).to.eql(true);
expect(user.stats.hp).to.eql(14);
});
});