Fix the test case
This commit is contained in:
parent
62f3f3af0d
commit
97f905ff1f
|
@ -15,7 +15,8 @@ module.exports = function(dataSource, should) {
|
|||
observersCalled = [];
|
||||
|
||||
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 },
|
||||
extra: { type: String, required: false }
|
||||
});
|
||||
|
@ -712,6 +713,9 @@ module.exports = function(dataSource, should) {
|
|||
existingInstance.save(function(err, instance) {
|
||||
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({
|
||||
data: {
|
||||
id: existingInstance.id,
|
||||
|
@ -719,8 +723,7 @@ module.exports = function(dataSource, should) {
|
|||
},
|
||||
currentInstance: {
|
||||
id: existingInstance.id,
|
||||
name: 'changed',
|
||||
extra: undefined
|
||||
name: 'changed'
|
||||
},
|
||||
where: { id: existingInstance.id },
|
||||
options: { throws: false, validate: true }
|
||||
|
|
Loading…
Reference in New Issue