@@ -277,32 +277,34 @@ describe("Model.get()", function() {
277277 } ) ;
278278 } ) ;
279279
280- describe ( "with a point property type" , function ( ) {
281- before ( function ( done ) {
282- Person = db . define ( "person" , {
283- name : String ,
284- location : { type : 'point' }
285- } ) ;
286-
287- ORM . singleton . clear ( ) ;
288-
289- return helper . dropSync ( Person , function ( ) {
290- Person . create ( [ {
291- name : "John Doe" ,
292- location : { x : 51.5177 , y : - 0.0968 }
293- } ] , done ) ;
294- } ) ;
295- } ) ;
296-
297- it ( "should deserialize the point to an array" , function ( done ) {
298- Person . get ( "John Doe" , function ( err , person ) {
299- should . equal ( err , null ) ;
300-
301- person . location . should . be . an . instanceOf ( Object ) ;
302- person . location . should . have . property ( 'x' , 51.5177 ) ;
303- person . location . should . have . property ( 'y' , - 0.0968 ) ;
304- return done ( ) ;
305- } ) ;
306- } ) ;
307- } ) ;
280+ describe ( "with a point property type" , function ( ) {
281+ it ( "should deserialize the point to an array" , function ( done ) {
282+ db . settings . set ( 'properties.primary_key' , 'id' ) ;
283+
284+ Person = db . define ( "person" , {
285+ name : String ,
286+ location : { type : "point" }
287+ } ) ;
288+
289+ ORM . singleton . clear ( ) ;
290+
291+ return helper . dropSync ( Person , function ( err ) {
292+ if ( err ) {
293+ return done ( ) ; // not supported
294+ }
295+
296+ Person . create ( {
297+ name : "John Doe" ,
298+ location : { x : 51.5177 , y : - 0.0968 }
299+ } , function ( err , person ) {
300+ should . equal ( err , null ) ;
301+
302+ person . location . should . be . an . instanceOf ( Object ) ;
303+ person . location . should . have . property ( 'x' , 51.5177 ) ;
304+ person . location . should . have . property ( 'y' , - 0.0968 ) ;
305+ return done ( ) ;
306+ } ) ;
307+ } ) ;
308+ } ) ;
309+ } ) ;
308310} ) ;
0 commit comments