Creating the route for updating keywords

We also need to be able to save changes to an existing keyword entry. This is another POST request, this time at /api/keywords/:i/*. Here is the spec for this:

 it('should update a keyword when receiving a POST request at \ /api/keywords/:id/', function (done) { var expected = { "_items": [ {'id': 1, 'value': 'Onion', 'categoryID': 2} ] }; var body = { 'id': 1, 'value': 'Onion', 'categoryID': 2 }; async.series( [ function(callback) { dbSession.insert( 'category', {'name': 'Vegetable'}, function(err) { callback(err) }); }, function(callback) { dbSession.insert( 'category', {'name': 'Utility'}, function(err) { callback(err) }); }, function(callback) { dbSession.insert( 'keyword', {'value': 'Aubergine', ...

Get The Node Craftsman Book now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.