Skip to content

Commit

Permalink
Fills in basic custom hook test.
Browse files Browse the repository at this point in the history
  • Loading branch information
mikermcneil committed Jan 4, 2014
1 parent dddc21d commit 2c9739a
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions test/unit/app.initializeHooks.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,26 @@ describe('app.initializeHooks()', function() {
it('should expose hooks on the `sails` global', function () {
this.sails.hooks.should.be.an.Object;
});
it('should expose at least the expected hooks', function () {
it('should expose at least the expected core hooks', function () {
this.sails.hooks.should.have
.properties(constants.EXPECTED_DEFAULT_HOOKS);
});
});



describe('configured with a custom hook', function () {
describe('configured with a custom hook called `someCustomHook`', function () {
$Sails.load({
hooks: { myCustomHook: customHooks.NOOP }
hooks: { someCustomHook: customHooks.NOOP }
});

it('should expose `someCustomHook`', function () {
this.sails.hooks.should.have
.property('someCustomHook');
});
it('should also expose the expected core hooks', function () {
this.sails.hooks.should.have
.properties(constants.EXPECTED_DEFAULT_HOOKS);
});
});

Expand Down

0 comments on commit 2c9739a

Please sign in to comment.