Skip to content

Commit

Permalink
test: remove global autoAttach
Browse files Browse the repository at this point in the history
  • Loading branch information
Miroslav Bajtoš committed Apr 7, 2015
1 parent b61fae5 commit 699bc7a
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions test/model.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -501,9 +501,11 @@ describe.onServer('Remote Methods', function() {
describe('Model._getACLModel()', function() {
it('should return the subclass of ACL', function() {
var Model = require('../').Model;
var originalValue = Model._ACL();
var acl = ACL.extend('acl');
Model._ACL(null); // Reset the ACL class for the base model
var model = Model._ACL();
Model._ACL(originalValue); // Reset the value back
assert.equal(model, acl);
});
});
Expand Down
1 change: 1 addition & 0 deletions test/rest.middleware.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ describe('loopback.rest', function() {
beforeEach(function() {
var ds = app.dataSource('db', { connector: loopback.Memory });
MyModel = ds.createModel('MyModel', {name: String});
loopback.autoAttach();
});

it('works out-of-the-box', function(done) {
Expand Down
3 changes: 0 additions & 3 deletions test/support.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@ beforeEach(function() {
{type: 'STUB'}
]
});

// auto attach data sources to models
loopback.autoAttach();
});

assertValidDataSource = function(dataSource) {
Expand Down
2 changes: 2 additions & 0 deletions test/user.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ describe('User', function() {

// Update the AccessToken relation to use the subclass of User
AccessToken.belongsTo(User);
User.hasMany(AccessToken);

// allow many User.afterRemote's to be called
User.setMaxListeners(0);
Expand Down Expand Up @@ -1071,6 +1072,7 @@ describe('User', function() {
assert.equal(info.accessToken.ttl / 60, 15);
assert(calledBack);
info.accessToken.user(function(err, user) {
if (err) return done(err);
assert.equal(user.email, email);
done();
});
Expand Down

0 comments on commit 699bc7a

Please sign in to comment.