Merge pull request #645 from strongloop/fix/persistence-hooks-tests

test: fix persistence-hooks failures in MySQL
This commit is contained in:
Miroslav Bajtoš 2015-06-24 18:42:32 +02:00
commit ec81f20178
1 changed files with 4 additions and 3 deletions

View File

@ -942,14 +942,15 @@ module.exports = function(dataSource, should) {
it('triggers `loaded` hook', function(done) { it('triggers `loaded` hook', function(done) {
TestModel.observe('loaded', pushContextAndNext()); TestModel.observe('loaded', pushContextAndNext());
existingInstance.name = 'changed'; existingInstance.extra = 'changed';
existingInstance.save(function(err, instance) { existingInstance.save(function(err, instance) {
if (err) return done(err); if (err) return done(err);
observedContexts.should.eql(aTestModelCtx({ observedContexts.should.eql(aTestModelCtx({
data: { data: {
id: existingInstance.id, id: existingInstance.id,
name: 'changed' name: existingInstance.name,
extra: 'changed',
}, },
isNewInstance: false, isNewInstance: false,
options: { throws: false, validate: true } options: { throws: false, validate: true }
@ -2040,7 +2041,7 @@ module.exports = function(dataSource, should) {
TestModel.observe('loaded', pushContextAndNext()); TestModel.observe('loaded', pushContextAndNext());
TestModel.updateAll( TestModel.updateAll(
{ where: { id: existingInstance.id } }, { id: existingInstance.id },
{ name: 'changed' }, { name: 'changed' },
function(err, instance) { function(err, instance) {
if (err) return done(err); if (err) return done(err);