@@ -339,6 +339,15 @@ describe('Memory connector', function() {
339339 } ) ;
340340 } ) ;
341341
342+ it ( 'should successfully extract 1 user (Lennon) from the db by date' , function ( done ) {
343+ User . find ( { where : { birthday : new Date ( '1980-12-08' ) } } ,
344+ function ( err , users ) {
345+ should ( users . length ) . be . equal ( 1 ) ;
346+ should ( users [ 0 ] . name ) . be . equal ( 'John Lennon' ) ;
347+ done ( ) ;
348+ } ) ;
349+ } ) ;
350+
342351 it ( 'should successfully extract 2 users from the db' , function ( done ) {
343352 User . find ( { where : { birthday : { between : [ new Date ( 1940 , 0 ) , new Date ( 1990 , 0 ) ] } } } ,
344353 function ( err , users ) {
@@ -565,6 +574,33 @@ describe('Memory connector', function() {
565574 } ) ;
566575 } ) ;
567576
577+ it ( 'should handle constructor.prototype' , function ( done ) {
578+ User . find ( { where : { 'constructor.prototype' : { toString : 'Not a function' } } } , function ( err ,
579+ users ) {
580+ should . not . exist ( err ) ;
581+ users . length . should . equal ( 0 ) ;
582+ done ( ) ;
583+ } ) ;
584+ } ) ;
585+
586+ it ( 'should handle constructor/prototype' , function ( done ) {
587+ User . find ( { where : { constructor : { prototype : { toString : 'Not a function' } } } } , function ( err ,
588+ users ) {
589+ should . not . exist ( err ) ;
590+ users . length . should . equal ( 0 ) ;
591+ done ( ) ;
592+ } ) ;
593+ } ) ;
594+
595+ it ( 'should handle toString' , function ( done ) {
596+ User . find ( { where : { toString : 'Not a function' } } , function ( err ,
597+ users ) {
598+ should . not . exist ( err ) ;
599+ users . length . should . equal ( 0 ) ;
600+ done ( ) ;
601+ } ) ;
602+ } ) ;
603+
568604 function seed ( done ) {
569605 const beatles = [
570606 {
0 commit comments