@@ -137,6 +137,46 @@ describe("Testing jsonapi-server", function() {
137137 } ) ;
138138 } ) ;
139139
140+ describe ( "equality for booleans" , function ( ) {
141+
142+ it ( "matches false" , function ( done ) {
143+ var url = "http://localhost:16006/rest/photos?filter[raw]=false" ;
144+ helpers . request ( {
145+ method : "GET" ,
146+ url : url
147+ } , function ( err , res , json ) {
148+ assert . equal ( err , null ) ;
149+ json = helpers . validateJson ( json ) ;
150+
151+ assert . equal ( res . statusCode , "200" , "Expecting 200 OK" ) ;
152+ var photoTypes = json . data . map ( function ( i ) { return i . attributes . raw ; } ) ;
153+ assert . deepEqual ( photoTypes , [ false , false ] , "expected matching resources" ) ;
154+
155+ done ( ) ;
156+ } ) ;
157+ } ) ;
158+
159+ it ( "matches true" , function ( done ) {
160+ var url = "http://localhost:16006/rest/photos?filter[raw]=true" ;
161+ helpers . request ( {
162+ method : "GET" ,
163+ url : url
164+ } , function ( err , res , json ) {
165+ assert . equal ( err , null ) ;
166+ json = helpers . validateJson ( json ) ;
167+
168+ assert . equal ( res . statusCode , "200" , "Expecting 200 OK" ) ;
169+ var photoTypes = json . data . map ( function ( i ) { return i . attributes . raw ; } ) ;
170+ assert . deepEqual ( photoTypes , [ true ] , "expected matching resources" ) ;
171+
172+ done ( ) ;
173+ } ) ;
174+ } ) ;
175+
176+
177+ } ) ;
178+
179+
140180 it ( "less than for strings" , function ( done ) {
141181 var url = "http://localhost:16006/rest/articles?filter[title]=<M" ;
142182 helpers . request ( {
0 commit comments