@@ -1381,6 +1381,8 @@ describe('DataAccessObject', function() {
1381
1381
} ,
1382
1382
location : 'GeoPoint' ,
1383
1383
scores : [ Number ] ,
1384
+ array : 'array' ,
1385
+ object : 'object' ,
1384
1386
} ) ;
1385
1387
} ) ;
1386
1388
@@ -1638,7 +1640,7 @@ describe('DataAccessObject', function() {
1638
1640
assert ( error , 'An error should have been thrown' ) ;
1639
1641
} ) ;
1640
1642
1641
- it ( 'throws an error if the filter.limit property is nagative ' , function ( ) {
1643
+ it ( 'throws an error if the filter.limit property is negative ' , function ( ) {
1642
1644
try {
1643
1645
// The limit param must be a valid number
1644
1646
filter = model . _normalize ( { limit : - 1 } ) ;
@@ -1719,6 +1721,18 @@ describe('DataAccessObject', function() {
1719
1721
assert . deepEqual ( where , { date : undefined } ) ;
1720
1722
} ) ;
1721
1723
1724
+ it ( 'does not coerce empty objects to arrays' , function ( ) {
1725
+ where = model . _coerce ( { object : { } } ) ;
1726
+ where . object . should . not . be . an . Array ( ) ;
1727
+ where . object . should . be . an . Object ( ) ;
1728
+ } ) ;
1729
+
1730
+ it ( 'does not coerce an empty array' , function ( ) {
1731
+ where = model . _coerce ( { array : [ ] } ) ;
1732
+ where . array . should . be . an . Array ( ) ;
1733
+ where . array . should . have . length ( 0 ) ;
1734
+ } ) ;
1735
+
1722
1736
it ( 'does not coerce to a number for a simple value that produces NaN' , function ( ) {
1723
1737
where = model . _coerce ( { age : 'xyz' } ) ;
1724
1738
assert . deepEqual ( where , { age : 'xyz' } ) ;
0 commit comments