topic: function() { var TestController = new Controller(); TestController._load({ name: 'application' }, 'TestController'); TestController.foo = function() { this.song = 'mr-jones'; this.render(); } TestController.after('foo', function(next) { this.band = 'counting-crows'; next(new Error('something went wrong')); }); TestController.after('foo', function(next) { this.album = 'august-and-everything-after'; next(); }); var instance = Object.create(TestController); return instance; },
topic: function() { var TestController = new Controller(); TestController._load({ name: 'application' }, 'TestController'); TestController.foo = function() { this.song = 'mr-jones'; this.render(); } TestController.after('foo', function(req, res, next) { req.middleware = 'called'; this.finished(); next(); }); var instance = Object.create(TestController); return instance; },
topic: function() { var TestController = new Controller(); TestController._load({ name: 'application' }, 'TestController'); TestController.foo = function() { this.song = 'the-end'; this.render(); } TestController.bar = function() { this.song = 'break-on-through'; this.render(); } TestController.after('*', function(next) { this.band = 'the-doors'; this.finished(); next(); }); return TestController; },