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) {
TestModel.observe('loaded', pushContextAndNext());
existingInstance.name = 'changed';
existingInstance.extra = 'changed';
existingInstance.save(function(err, instance) {
if (err) return done(err);
observedContexts.should.eql(aTestModelCtx({
data: {
id: existingInstance.id,
name: 'changed'
name: existingInstance.name,
extra: 'changed',
},
isNewInstance: false,
options: { throws: false, validate: true }
@ -2040,7 +2041,7 @@ module.exports = function(dataSource, should) {
TestModel.observe('loaded', pushContextAndNext());
TestModel.updateAll(
{ where: { id: existingInstance.id } },
{ id: existingInstance.id },
{ name: 'changed' },
function(err, instance) {
if (err) return done(err);