Skip to content

Commit

Permalink
Apply review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
gunjpan committed Jun 9, 2016
1 parent 18473f9 commit 7839b88
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
2 changes: 1 addition & 1 deletion lib/application.js
Expand Up @@ -115,7 +115,7 @@ app.model = function(Model, config) {
if (typeof Model === 'string') {
var msg = 'app.model(modelName, settings) is no longer supported. ' +
'Use app.registry.createModel(modelName, definition) and ' +
'app.model(modelCtor, config) instead.';
'app.model(ModelCtor, config) instead.';
throw new Error(msg);
}

Expand Down
16 changes: 6 additions & 10 deletions test/acl.test.js
Expand Up @@ -393,20 +393,16 @@ describe('security ACLs', function() {
});

describe('access check', function() {
var app;
before(function() {
app = loopback();
it('should occur before other remote hooks', function(done) {
var app = loopback();
var MyTestModel = app.registry.createModel('MyTestModel');
var checkAccessCalled = false;
var beforeHookCalled = false;

app.use(loopback.rest());
app.enableAuth();
app.dataSource('test', { connector: 'memory' });
var MyTestModel = app.registry.createModel('MyTestModel');
app.model(MyTestModel, { dataSource: 'test' });
});

it('should occur before other remote hooks', function(done) {
var MyTestModel = app.models.MyTestModel;
var checkAccessCalled = false;
var beforeHookCalled = false;

// fake / spy on the checkAccess method
MyTestModel.checkAccess = function() {
Expand Down

0 comments on commit 7839b88

Please sign in to comment.