Skip to content

Commit

Permalink
Fix test broken by recent juggler changes
Browse files Browse the repository at this point in the history
The patch loopbackio/loopback-datasource-juggler#436 changed the way
how `Model.extend` works, which broke one loopback test relying on the
old behaviour.

This commit fixes the failing test. The test is checking now that
the model base was not changed, instead of checking that the base
is undefined.
  • Loading branch information
Miroslav Bajtoš committed Feb 20, 2015
1 parent a19f393 commit c925e66
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"underscore.string": "~2.3.3"
},
"peerDependencies": {
"loopback-datasource-juggler": "^2.8.0"
"loopback-datasource-juggler": "^2.17.0"
},
"devDependencies": {
"browserify": "~4.2.3",
Expand All @@ -79,7 +79,7 @@
"karma-phantomjs-launcher": "~0.1.4",
"karma-script-launcher": "~0.1.0",
"loopback-boot": "^1.1.0",
"loopback-datasource-juggler": "^2.8.0",
"loopback-datasource-juggler": "^2.17.0",
"loopback-testing": "~0.2.0",
"mocha": "~1.21.4",
"serve-favicon": "~2.1.3",
Expand Down
6 changes: 5 additions & 1 deletion test/loopback.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,8 @@ describe('loopback', function() {
emailVerificationRequired: false
});

var baseName = model.settings.base.name;

loopback.configureModel(model, {
dataSource: null,
options: {
Expand All @@ -357,7 +359,9 @@ describe('loopback', function() {
expect(model.settings).to.have.property('emailVerificationRequired',
false);
expect(model.settings).to.have.property('realmRequired', true);
expect(model.settings).to.not.have.property('base');

// configureModel MUST NOT change Model's base class
expect(model.settings.base.name).to.equal(baseName);
});
});

Expand Down

0 comments on commit c925e66

Please sign in to comment.