new tests

This commit is contained in:
Tyrel Souza 2017-11-29 23:24:51 -05:00
parent 27ae801067
commit d4b45e1bd8
1 changed files with 18 additions and 2 deletions

View File

@ -28,7 +28,23 @@ describe('POST /todos', () => {
expect(todos.length).toBe(1);
expect(todos[0].text).toBe(text);
done();
})
}).catch((e) => done(e));
}).catch((e) => done(e));
})
});
it('should NOT create a new todo', (done) => {
request(app)
.post('/todos')
.send()
.expect(400)
.end((err, res) => {
if (err) {
return done(err);
}
Todo.find().then((todos) => {
expect(todos.length).toBe(0);
done();
}).catch((e) => done(e));
})
});
});