change response for shared.ops.sleep, save user in POST /user/sleep and add integration tests for it

This commit is contained in:
Matteo Pagliazzi
2016-03-15 17:05:07 +01:00
parent 490c6a9ae1
commit b2b4340ee3
4 changed files with 38 additions and 10 deletions

View File

@@ -4,15 +4,15 @@ import {
} from '../../helpers/common.helper';
describe('shared.ops.sleep', () => {
it('changes user.preferences.sleep and returns the new value', () => {
it('toggles user.preferences.sleep', () => {
let user = generateUser();
let res = sleep(user);
expect(res).to.equal(true);
expect(res).to.eql({preferences: {sleep: true}});
expect(user.preferences.sleep).to.equal(true);
let res2 = sleep(user);
expect(res2).to.equal(false);
expect(res2).to.eql({preferences: {sleep: false}});
expect(user.preferences.sleep).to.equal(false);
});
});