This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var sinon = require('sinon'); | |
var Promise = require('bookshelf/dialects/base/promise').Promise; | |
var Bookshelf = require('bookshelf'); | |
var unhandled = sinon.spy(); | |
var caught = sinon.spy(); | |
Promise.onPossiblyUnhandledRejection(unhandled); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
create = { | |
handler: function(request, reply) { | |
return new Address().save({ | |
name: request.payload.name, | |
address_line1: request.payload.address_line1 | |
}) | |
.call('fetch') | |
.then(reply) | |
.catch(reply); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ActualModel = ModelBase.extend({ | |
related: function() {this.hasOne(OtherModel);} | |
}); |