* feat: Add alias property to task model
This commit is contained in:
Blade Barringer
2016-06-16 12:28:45 -05:00
committed by GitHub
parent c34c21192b
commit b7b61e6251
21 changed files with 536 additions and 97 deletions

View File

@@ -6,7 +6,7 @@ import {
describe('DELETE /tasks/:id', () => {
let user;
before(async () => {
beforeEach(async () => {
user = await generateUser();
});
@@ -17,6 +17,7 @@ describe('DELETE /tasks/:id', () => {
task = await user.post('/tasks/user', {
text: 'test habit',
type: 'habit',
alias: 'task-to-be-deleted',
});
});
@@ -29,6 +30,16 @@ describe('DELETE /tasks/:id', () => {
message: t('taskNotFound'),
});
});
it('can use a alias to delete a task', async () => {
await user.del(`/tasks/${task.alias}`);
await expect(user.get(`/tasks/${task._id}`)).to.eventually.be.rejected.and.eql({
code: 404,
error: 'NotFound',
message: t('taskNotFound'),
});
});
});
context('task cannot be deleted', () => {