round priority on update too (#10186)

* round priority on update too

* move the fix to Task sanitizeTransform

* refactor the task.priority parsing
This commit is contained in:
negue
2018-04-14 16:16:25 +02:00
committed by Matteo Pagliazzi
parent a42cb0e3ab
commit 455f7ac59b
4 changed files with 19 additions and 7 deletions

View File

@@ -296,6 +296,16 @@ describe('PUT /tasks/:id', () => {
expect(fetchedDaily.text).to.eql('saved');
});
// This is a special case for iOS requests
it('will round a priority (difficulty)', async () => {
daily = await user.put(`/tasks/${daily._id}`, {
alias: 'alias',
priority: 0.10000000000005,
});
expect(daily.priority).to.eql(0.1);
});
});
context('habits', () => {