port shared.ops.allocate

This commit is contained in:
Matteo Pagliazzi
2016-03-15 18:41:23 +01:00
parent fb6c927ce9
commit 219ec01ce9
11 changed files with 160 additions and 12 deletions

View File

@@ -0,0 +1,29 @@
import {
generateUser,
} from '../../../../helpers/api-integration/v3';
describe('POST /user/sleep', () => {
let user;
beforeEach(async () => {
user = await generateUser();
});
// More tests in common code unit tests
it('toggles sleep status', async () => {
let res = await user.post(`/user/sleep`);
expect(res).to.eql({
preferences: {sleep: true},
});
await user.sync();
expect(user.preferences.sleep).to.be.true;
let res2 = await user.post(`/user/sleep`);
expect(res2).to.eql({
preferences: {sleep: false},
});
await user.sync();
expect(user.preferences.sleep).to.be.false;
});
});