Remove .attachTo() from tests
This commit is contained in:
parent
cb39ae7adb
commit
178e5dab30
|
@ -231,7 +231,8 @@ loopback.Email = require('./models/email');
|
|||
loopback.User = require('./models/user');
|
||||
loopback.Application = require('./models/application');
|
||||
loopback.AccessToken = require('./models/access-token');
|
||||
loopback.Role = require('./models/role');
|
||||
loopback.Role = require('./models/role').Role;
|
||||
loopback.RoleMapping = require('./models/role').RoleMapping;
|
||||
loopback.ACL = require('./models/acl').ACL;
|
||||
loopback.Scope = require('./models/acl').Scope;
|
||||
|
||||
|
@ -249,6 +250,7 @@ loopback.Email.autoAttach = dataSourceTypes.MAIL;
|
|||
loopback.User.autoAttach = dataSourceTypes.DB;
|
||||
loopback.AccessToken.autoAttach = dataSourceTypes.DB;
|
||||
loopback.Role.autoAttach = dataSourceTypes.DB;
|
||||
loopback.RoleMapping.autoAttach = dataSourceTypes.DB;
|
||||
loopback.ACL.autoAttach = dataSourceTypes.DB;
|
||||
loopback.Scope.autoAttach = dataSourceTypes.DB;
|
||||
loopback.Application.autoAttach = dataSourceTypes.DB;
|
||||
|
|
|
@ -13,10 +13,6 @@ function checkResult(err, result) {
|
|||
describe('role model', function () {
|
||||
|
||||
it("should define role/role relations", function () {
|
||||
var ds = loopback.createDataSource({connector: 'memory'});
|
||||
Role.attachTo(ds);
|
||||
RoleMapping.attachTo(ds);
|
||||
|
||||
Role.create({name: 'user'}, function (err, userRole) {
|
||||
Role.create({name: 'admin'}, function (err, adminRole) {
|
||||
userRole.principals.create({principalType: RoleMapping.ROLE, principalId: adminRole.id}, function (err, mapping) {
|
||||
|
@ -41,11 +37,6 @@ describe('role model', function () {
|
|||
});
|
||||
|
||||
it("should define role/user relations", function () {
|
||||
var ds = loopback.createDataSource({connector: 'memory'});
|
||||
User.attachTo(ds);
|
||||
Role.attachTo(ds);
|
||||
RoleMapping.attachTo(ds);
|
||||
|
||||
User.create({name: 'Raymond', email: 'x@y.com', password: 'foobar'}, function (err, user) {
|
||||
// console.log('User: ', user.id);
|
||||
Role.create({name: 'userRole'}, function (err, role) {
|
||||
|
@ -75,11 +66,6 @@ describe('role model', function () {
|
|||
});
|
||||
|
||||
it("should support getRoles() and isInRole()", function () {
|
||||
var ds = loopback.createDataSource({connector: 'memory'});
|
||||
User.attachTo(ds);
|
||||
Role.attachTo(ds);
|
||||
RoleMapping.attachTo(ds);
|
||||
|
||||
User.create({name: 'Raymond', email: 'x@y.com', password: 'foobar'}, function (err, user) {
|
||||
// console.log('User: ', user.id);
|
||||
Role.create({name: 'userRole'}, function (err, role) {
|
||||
|
|
Loading…
Reference in New Issue