adapt current tests and change urls to avoid conflicts

This commit is contained in:
Matteo Pagliazzi
2016-01-04 22:03:21 +01:00
parent 6680853078
commit 3bc8945bcc
14 changed files with 105 additions and 94 deletions

View File

@@ -16,7 +16,7 @@ describe('DELETE /tasks/:taskId/checklist/:itemId', () => {
it('deletes a checklist item', () => {
let task;
return user.post('/tasks', {
return user.post('/tasks?tasksOwner=user', {
type: 'daily',
text: 'Daily with checklist',
}).then(createdTask => {
@@ -33,7 +33,7 @@ describe('DELETE /tasks/:taskId/checklist/:itemId', () => {
it('does not work with habits', () => {
let habit;
return expect(user.post('/tasks', {
return expect(user.post('/tasks?tasksOwner=user', {
type: 'habit',
text: 'habit with checklist',
}).then(createdTask => {
@@ -47,7 +47,7 @@ describe('DELETE /tasks/:taskId/checklist/:itemId', () => {
});
it('does not work with rewards', async () => {
let reward = await user.post('/tasks', {
let reward = await user.post('/tasks?tasksOwner=user', {
type: 'reward',
text: 'reward with checklist',
});
@@ -68,7 +68,7 @@ describe('DELETE /tasks/:taskId/checklist/:itemId', () => {
});
it('fails on checklist item not found', () => {
return expect(user.post('/tasks', {
return expect(user.post('/tasks?tasksOwner=user', {
type: 'daily',
text: 'daily with checklist',
}).then(createdTask => {

View File

@@ -16,7 +16,7 @@ describe('POST /tasks/:taskId/checklist/', () => {
it('adds a checklist item to a task', () => {
let task;
return user.post('/tasks', {
return user.post('/tasks?tasksOwner=user', {
type: 'daily',
text: 'Daily with checklist',
}).then(createdTask => {
@@ -36,7 +36,7 @@ describe('POST /tasks/:taskId/checklist/', () => {
it('does not add a checklist to habits', () => {
let habit;
return expect(user.post('/tasks', {
return expect(user.post('/tasks?tasksOwner=user', {
type: 'habit',
text: 'habit with checklist',
}).then(createdTask => {
@@ -51,7 +51,7 @@ describe('POST /tasks/:taskId/checklist/', () => {
it('does not add a checklist to rewards', () => {
let reward;
return expect(user.post('/tasks', {
return expect(user.post('/tasks?tasksOwner=user', {
type: 'reward',
text: 'reward with checklist',
}).then(createdTask => {

View File

@@ -16,7 +16,7 @@ describe('POST /tasks/:taskId/checklist/:itemId/score', () => {
it('scores a checklist item', () => {
let task;
return user.post('/tasks', {
return user.post('/tasks?tasksOwner=user', {
type: 'daily',
text: 'Daily with checklist',
}).then(createdTask => {
@@ -32,7 +32,7 @@ describe('POST /tasks/:taskId/checklist/:itemId/score', () => {
it('fails on habits', () => {
let habit;
return expect(user.post('/tasks', {
return expect(user.post('/tasks?tasksOwner=user', {
type: 'habit',
text: 'habit with checklist',
}).then(createdTask => {
@@ -46,7 +46,7 @@ describe('POST /tasks/:taskId/checklist/:itemId/score', () => {
});
it('fails on rewards', async () => {
let reward = await user.post('/tasks', {
let reward = await user.post('/tasks?tasksOwner=user', {
type: 'reward',
text: 'reward with checklist',
});
@@ -67,7 +67,7 @@ describe('POST /tasks/:taskId/checklist/:itemId/score', () => {
});
it('fails on checklist item not found', () => {
return expect(user.post('/tasks', {
return expect(user.post('/tasks?tasksOwner=user', {
type: 'daily',
text: 'daily with checklist',
}).then(createdTask => {

View File

@@ -16,7 +16,7 @@ describe('PUT /tasks/:taskId/checklist/:itemId', () => {
it('updates a checklist item', () => {
let task;
return user.post('/tasks', {
return user.post('/tasks?tasksOwner=user', {
type: 'daily',
text: 'Daily with checklist',
}).then(createdTask => {
@@ -33,7 +33,7 @@ describe('PUT /tasks/:taskId/checklist/:itemId', () => {
});
it('fails on habits', async () => {
let habit = await user.post('/tasks', {
let habit = await user.post('/tasks?tasksOwner=user', {
type: 'habit',
text: 'habit with checklist',
});
@@ -46,7 +46,7 @@ describe('PUT /tasks/:taskId/checklist/:itemId', () => {
});
it('fails on rewards', async () => {
let reward = await user.post('/tasks', {
let reward = await user.post('/tasks?tasksOwner=user', {
type: 'reward',
text: 'reward with checklist',
});
@@ -67,7 +67,7 @@ describe('PUT /tasks/:taskId/checklist/:itemId', () => {
});
it('fails on checklist item not found', () => {
return expect(user.post('/tasks', {
return expect(user.post('/tasks?tasksOwner=user', {
type: 'daily',
text: 'daily with checklist',
}).then(createdTask => {