Skip to content
This repository has been archived by the owner on Oct 9, 2019. It is now read-only.

Commit

Permalink
Merge 4b2d195 into eccac0a
Browse files Browse the repository at this point in the history
  • Loading branch information
pon committed Jan 29, 2015
2 parents eccac0a + 4b2d195 commit ea498fb
Showing 1 changed file with 23 additions and 4 deletions.
27 changes: 23 additions & 4 deletions test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,17 +91,36 @@ describe('bookshelf plugin', function () {
}
},
plugins: ['registry'],
models: path.join(__dirname + '/models'),
namespace: 'test'
models: path.join(__dirname + '/models')
}
}
], function (err) {
expect(err).to.be.undefined;
expect(server.plugins.bookshelf.test.model('User')).to.be.a('function');
expect(server.plugins.bookshelf.model('User')).to.be.a('function');
});
});

it('should allow namespacing for multiple registrations', function () {
it('should allow namespacing', function () {
var server = new Hapi.Server();

server.register([
{
register: require('../lib/'),
options: {
knex: {
client: 'sqlite3',
connection: {
filename: './database.sqlite'
}
},
plugins: ['registry'],
models: path.join(__dirname + '/models'),
namespace: 'test'
}
}
], function (err) {
expect(err).to.be.undefined;
expect(server.plugins.bookshelf.test.model('User')).to.be.a('function');
});
});
});

0 comments on commit ea498fb

Please sign in to comment.