Api v3 Migration (WIP) (#7131)

* v3 migration: remove old code and polish user migration

* v3 migration: start to work on challenges

* wip v3 migration

* wip v3 migration: fix _id -> id for reminders, tags and checklists
This commit is contained in:
Matteo Pagliazzi
2016-04-30 18:34:16 +02:00
parent f69a566178
commit 6380161321
24 changed files with 350 additions and 203 deletions

View File

@@ -154,14 +154,14 @@ describe('POST /tasks/user', () => {
text: 'test habit',
type: 'habit',
reminders: [
{_id: id1, startDate: new Date(), time: new Date()},
{id: id1, startDate: new Date(), time: new Date()},
],
});
expect(task.reminders).to.be.an('array');
expect(task.reminders.length).to.eql(1);
expect(task.reminders[0]).to.be.an('object');
expect(task.reminders[0]._id).to.eql(id1);
expect(task.reminders[0].id).to.eql(id1);
expect(task.reminders[0].startDate).to.be.a('string'); // json doesn't have dates
expect(task.reminders[0].time).to.be.a('string');
});
@@ -345,7 +345,7 @@ describe('POST /tasks/user', () => {
expect(task.checklist[0]).to.be.an('object');
expect(task.checklist[0].text).to.eql('checklist');
expect(task.checklist[0].completed).to.eql(false);
expect(task.checklist[0]._id).to.be.a('string');
expect(task.checklist[0].id).to.be.a('string');
});
});
@@ -487,7 +487,7 @@ describe('POST /tasks/user', () => {
expect(task.checklist[0]).to.be.an('object');
expect(task.checklist[0].text).to.eql('checklist');
expect(task.checklist[0].completed).to.eql(false);
expect(task.checklist[0]._id).to.be.a('string');
expect(task.checklist[0].id).to.be.a('string');
});
});