Now it's time for the final step. We need to add route handling for DELETE requests, and our application is complete.
Once again, we start with the spec:
it('should remove a keyword when receiving a DELETE request at \ /api/keywords/: id/', function (done){
var expected = {
"_items": [
{'id': 1, 'value': 'Aubergine', 'categoryID': 1}
]
};
async.series(
[
function(callback) {
dbSession.insert(
'category',
{'name': 'Vegetable'},
function(err) { callback(err) });
},
function(callback) {
dbSession.insert(
'keyword',
{'value': 'Aubergine', 'categoryID': 1},
function(err) { callback(err...