Merge pull request #6733 from vIiRuS/mobileStorage

Store data for next mobile update
This commit is contained in:
Sabe Jones
2016-03-09 14:56:15 -06:00
5 changed files with 50 additions and 4 deletions

View File

@@ -175,4 +175,27 @@ describe('PUT /user', () => {
});
});
});
context('Improvement Categories', () => {
it('sets valid categories', async () => {
await user.put('/user', {
'preferences.improvementCategories': ['work', 'school'],
});
await user.sync();
expect(user.preferences.improvementCategories).to.eql(['work', 'school']);
});
it('discards invalid categories', async () => {
await expect(user.put('/user', {
'preferences.improvementCategories': ['work', 'procrastination', 'school'],
})).to.eventually.be.rejected.and.eql({
code: 400,
text: [
'Validator failed for path `preferences.improvementCategories` with value `work,procrastination,school`',
],
});
});
});
});