@@ -1356,6 +1356,7 @@ module.exports = function(dataSource, should, connectorCapabilities) {
13561356
13571357 ctxRecorder . records . should . eql ( aCtxForModel ( TestModel , {
13581358 data : { name : 'changed' } ,
1359+ isNewInstance : false ,
13591360 } ) ) ;
13601361
13611362 done ( ) ;
@@ -2010,19 +2011,13 @@ module.exports = function(dataSource, should, connectorCapabilities) {
20102011 function ( err , instance ) {
20112012 if ( err ) return done ( err ) ;
20122013
2013- if ( dataSource . connector . updateOrCreate ) {
2014- ctxRecorder . records . should . eql ( aCtxForModel ( TestModel , {
2015- data : { id : 'new-id' , name : 'a name' } ,
2016- } ) ) ;
2017- } else {
2018- ctxRecorder . records . should . eql ( aCtxForModel ( TestModel , {
2019- data : {
2020- id : 'new-id' ,
2021- name : 'a name' ,
2022- } ,
2023- isNewInstance : true ,
2024- } ) ) ;
2025- }
2014+ ctxRecorder . records . should . eql ( aCtxForModel ( TestModel , {
2015+ data : {
2016+ id : 'new-id' ,
2017+ name : 'a name' ,
2018+ } ,
2019+ isNewInstance : true ,
2020+ } ) ) ;
20262021 done ( ) ;
20272022 } ) ;
20282023 } ) ;
@@ -2034,24 +2029,13 @@ module.exports = function(dataSource, should, connectorCapabilities) {
20342029 { id : existingInstance . id , name : 'updated name' } ,
20352030 function ( err , instance ) {
20362031 if ( err ) return done ( err ) ;
2037-
2038- if ( dataSource . connector . updateOrCreate ) {
2039- ctxRecorder . records . should . eql ( aCtxForModel ( TestModel , {
2040- data : {
2041- id : existingInstance . id ,
2042- name : 'updated name' ,
2043- } ,
2044- } ) ) ;
2045- } else {
2046- ctxRecorder . records . should . eql (
2047- aCtxForModel ( TestModel , {
2048- data : {
2049- id : existingInstance . id ,
2050- name : 'updated name' ,
2051- } ,
2052- } )
2053- ) ;
2054- }
2032+ ctxRecorder . records . should . eql ( aCtxForModel ( TestModel , {
2033+ data : {
2034+ id : existingInstance . id ,
2035+ name : 'updated name' ,
2036+ } ,
2037+ isNewInstance : false ,
2038+ } ) ) ;
20552039 done ( ) ;
20562040 } ) ;
20572041 } ) ;
@@ -3259,13 +3243,8 @@ module.exports = function(dataSource, should, connectorCapabilities) {
32593243 id : existingInstance . id ,
32603244 name : 'updated name' ,
32613245 } ,
3246+ isNewInstance : false ,
32623247 } ) ;
3263- // For non-atomic implementation of upsertWithWhere on update, it calls
3264- // updateAttributes. loaded hook of updateAttributes does not provide
3265- // isNewInstance.
3266- if ( dataSource . connector . upsertWithWhere ) {
3267- expectedContext . isNewInstance = false ;
3268- }
32693248 ctxRecorder . records . should . eql ( aCtxForModel ( TestModel , expectedContext ) ) ;
32703249 done ( ) ;
32713250 } ) ;
0 commit comments