loopback
loopback copied to clipboard
ACL test fail with mongoDB
I change the datasource to mongoDB in file loopback/test/acl.test.js,
var ds = this.ds = loopback.createDataSource({connector: require('loopback-connector-mongodb')});
But the test output show error:
8 passing (483ms)
1 failing
1) security ACLs should allow access to models by exception:
Uncaught AssertionError: false == true
It's ok when use the default memory db. I don't know why it fails, is anything different between memory db and mongoDB. Thanks!
Got solved, close it.
What was the issue?
The principalId is the ACL model is string. ObjectID needs to be converted to string.
It's fixed by https://github.com/strongloop/loopback/pull/246.