@@ -247,98 +247,88 @@ describe('postgresql connector', function() {
247
247
Post . destroyAll ( done ) ;
248
248
} ) ;
249
249
250
- it ( 'should support case sensitive queries using like' ,
251
- function ( done ) {
252
- Post . find ( { where : { content : { like : '%TestCase%' } } } ,
253
- function ( err , posts ) {
254
- should . not . exists ( err ) ;
255
- posts . length . should . equal ( 1 ) ;
256
- posts [ 0 ] . content . should . equal ( 'T1_TestCase' ) ;
257
- done ( ) ;
258
- } ) ;
250
+ it ( 'supports case sensitive queries using like' , function ( done ) {
251
+ Post . find ( { where : { content : { like : '%TestCase%' } } } , function ( err , posts ) {
252
+ if ( err ) return done ( err ) ;
253
+ posts . length . should . equal ( 1 ) ;
254
+ posts [ 0 ] . content . should . equal ( 'T1_TestCase' ) ;
255
+ done ( ) ;
259
256
} ) ;
257
+ } ) ;
260
258
261
- it ( 'should not support case insensitive queries using like' ,
262
- function ( done ) {
263
- Post . find ( { where : { content : { like : '%tesTcasE%' } } } ,
264
- function ( err , posts ) {
265
- should . not . exists ( err ) ;
266
- posts . length . should . equal ( 0 ) ;
267
- done ( ) ;
268
- } ) ;
259
+ it ( 'rejects case insensitive queries using like' , function ( done ) {
260
+ Post . find ( { where : { content : { like : '%tesTcasE%' } } } , function ( err , posts ) {
261
+ if ( err ) return done ( err ) ;
262
+ posts . length . should . equal ( 0 ) ;
263
+ done ( ) ;
269
264
} ) ;
265
+ } ) ;
270
266
271
- it ( 'should support like for no match' , function ( done ) {
272
- Post . find ( { where : { content : { like : '%TestXase%' } } } ,
273
- function ( err , posts ) {
274
- should . not . exists ( err ) ;
275
- posts . length . should . equal ( 0 ) ;
276
- done ( ) ;
277
- } ) ;
267
+ it ( 'supports like for no match' , function ( done ) {
268
+ Post . find ( { where : { content : { like : '%TestXase%' } } } , function ( err , posts ) {
269
+ if ( err ) return done ( err ) ;
270
+ posts . length . should . equal ( 0 ) ;
271
+ done ( ) ;
272
+ } ) ;
278
273
} ) ;
279
274
280
- it ( 'should support negative case sensitive queries using nlike' ,
281
- function ( done ) {
282
- Post . find ( { where : { content : { nlike : '%Case%' } } } ,
283
- function ( err , posts ) {
284
- should . not . exists ( err ) ;
285
- posts . length . should . equal ( 0 ) ;
286
- done ( ) ;
287
- } ) ;
275
+ it ( 'supports negative case sensitive queries using nlike' , function ( done ) {
276
+ Post . find ( { where : { content : { nlike : '%Case%' } } } , function ( err , posts ) {
277
+ if ( err ) return done ( err ) ;
278
+ posts . length . should . equal ( 0 ) ;
279
+ done ( ) ;
288
280
} ) ;
281
+ } ) ;
289
282
290
- it ( 'should not support negative case insensitive queries using nlike' ,
291
- function ( done ) {
292
- Post . find ( { where : { content : { nlike : '%casE%' } } } ,
293
- function ( err , posts ) {
294
- should . not . exists ( err ) ;
295
- posts . length . should . equal ( 2 ) ;
296
- done ( ) ;
297
- } ) ;
283
+ it ( 'rejects negative case insensitive queries using nlike' , function ( done ) {
284
+ Post . find ( { where : { content : { nlike : '%casE%' } } } , function ( err , posts ) {
285
+ if ( err ) return done ( err ) ;
286
+ posts . length . should . equal ( 2 ) ;
287
+ done ( ) ;
298
288
} ) ;
289
+ } ) ;
299
290
300
- it ( 'should support nlike for no match' , function ( done ) {
291
+ it ( 'supports nlike for no match' , function ( done ) {
301
292
Post . find ( { where : { content : { nlike : '%TestXase%' } } } ,
302
293
function ( err , posts ) {
303
- should . not . exists ( err ) ;
294
+ if ( err ) return done ( err ) ;
304
295
posts . length . should . equal ( 2 ) ;
305
296
done ( ) ;
306
297
} ) ;
307
298
} ) ;
308
299
309
- it ( 'should support case insensitive queries using ilike' , function ( done ) {
300
+ it ( 'supports case insensitive queries using ilike' , function ( done ) {
310
301
Post . find ( { where : { content : { ilike : '%tesTcasE%' } } } ,
311
302
function ( err , posts ) {
312
- should . not . exist ( err ) ;
303
+ if ( err ) return done ( err ) ;
313
304
posts . length . should . equal ( 1 ) ;
314
305
posts [ 0 ] . content . should . equal ( 'T1_TestCase' ) ;
315
306
done ( ) ;
316
307
} ) ;
317
308
} ) ;
318
309
319
- it ( 'should support ilike for no match' , function ( done ) {
310
+ it ( 'supports ilike for no match' , function ( done ) {
320
311
Post . find ( { where : { content : { ilike : '%tesTxasE%' } } } ,
321
312
function ( err , posts ) {
322
- should . not . exists ( err ) ;
313
+ if ( err ) return done ( err ) ;
323
314
posts . length . should . equal ( 0 ) ;
324
315
done ( ) ;
325
316
} ) ;
326
317
} ) ;
327
318
328
- it ( 'should support negative case insensitive queries using nilike' ,
319
+ it ( 'supports negative case insensitive queries using nilike' ,
329
320
function ( done ) {
330
- Post . find ( { where : { content : { nilike : '%casE%' } } } ,
331
- function ( err , posts ) {
332
- should . not . exist ( err ) ;
333
- posts . length . should . equal ( 0 ) ;
334
- done ( ) ;
335
- } ) ;
321
+ Post . find ( { where : { content : { nilike : '%casE%' } } } , function ( err , posts ) {
322
+ if ( err ) return done ( err ) ;
323
+ posts . length . should . equal ( 0 ) ;
324
+ done ( ) ;
325
+ } ) ;
336
326
} ) ;
337
327
338
- it ( 'should support nilike for no match' , function ( done ) {
328
+ it ( 'supports nilike for no match' , function ( done ) {
339
329
Post . find ( { where : { content : { nilike : '%tesTxasE%' } } } ,
340
330
function ( err , posts ) {
341
- should . not . exists ( err ) ;
331
+ if ( err ) return done ( err ) ;
342
332
posts . length . should . equal ( 2 ) ;
343
333
done ( ) ;
344
334
} ) ;
0 commit comments