Fix the test case
This commit is contained in:
parent
62f3f3af0d
commit
97f905ff1f
|
@ -15,7 +15,8 @@ module.exports = function(dataSource, should) {
|
||||||
observersCalled = [];
|
observersCalled = [];
|
||||||
|
|
||||||
TestModel = dataSource.createModel('TestModel', {
|
TestModel = dataSource.createModel('TestModel', {
|
||||||
id: { type: String, id: true, default: uid },
|
// Set id.generated to false to honor client side values
|
||||||
|
id: { type: String, id: true, generated: false, default: uid },
|
||||||
name: { type: String, required: true },
|
name: { type: String, required: true },
|
||||||
extra: { type: String, required: false }
|
extra: { type: String, required: false }
|
||||||
});
|
});
|
||||||
|
@ -712,6 +713,9 @@ module.exports = function(dataSource, should) {
|
||||||
existingInstance.save(function(err, instance) {
|
existingInstance.save(function(err, instance) {
|
||||||
if (err) return done(err);
|
if (err) return done(err);
|
||||||
|
|
||||||
|
// HACK: extra is undefined for NoSQL and null for SQL
|
||||||
|
delete observedContexts.data.extra;
|
||||||
|
delete observedContexts.currentInstance.extra;
|
||||||
observedContexts.should.eql(aTestModelCtx({
|
observedContexts.should.eql(aTestModelCtx({
|
||||||
data: {
|
data: {
|
||||||
id: existingInstance.id,
|
id: existingInstance.id,
|
||||||
|
@ -719,8 +723,7 @@ module.exports = function(dataSource, should) {
|
||||||
},
|
},
|
||||||
currentInstance: {
|
currentInstance: {
|
||||||
id: existingInstance.id,
|
id: existingInstance.id,
|
||||||
name: 'changed',
|
name: 'changed'
|
||||||
extra: undefined
|
|
||||||
},
|
},
|
||||||
where: { id: existingInstance.id },
|
where: { id: existingInstance.id },
|
||||||
options: { throws: false, validate: true }
|
options: { throws: false, validate: true }
|
||||||
|
|
Loading…
Reference in New Issue