@@ -238,12 +238,75 @@ describe("ORM.connect()", function () {
238238 return done ( ) ;
239239 } ) ;
240240 } ) ;
241+ } ) ;
241242
242- it ( "should allow pool and debug settings to be false" , function ( done ) {
243+ describe ( "query options" , function ( ) {
244+ it ( "should understand pool `'false'` from query string" , function ( done ) {
243245 var connString = common . getConnectionString ( ) + "debug=false&pool=false" ;
244- ORM . connect ( connString , function ( err , db ) {
245- db . driver . opts . pool . should . equal ( false ) ;
246- db . driver . opts . debug . should . equal ( false ) ;
246+ ORM . connect ( connString , function ( err , db ) {
247+ should . not . exist ( err ) ;
248+ should . strictEqual ( db . driver . opts . pool , false ) ;
249+ should . strictEqual ( db . driver . opts . debug , false ) ;
250+ done ( ) ;
251+ } ) ;
252+ } ) ;
253+
254+ it ( "should understand pool `'0'` from query string" , function ( done ) {
255+ var connString = common . getConnectionString ( ) + "debug=0&pool=0" ;
256+ ORM . connect ( connString , function ( err , db ) {
257+ should . not . exist ( err ) ;
258+ should . strictEqual ( db . driver . opts . pool , false ) ;
259+ should . strictEqual ( db . driver . opts . debug , false ) ;
260+ done ( ) ;
261+ } ) ;
262+ } ) ;
263+
264+ it ( "should understand pool `'true'` from query string" , function ( done ) {
265+ var connString = common . getConnectionString ( ) + "debug=true&pool=true" ;
266+ ORM . connect ( connString , function ( err , db ) {
267+ should . not . exist ( err ) ;
268+ should . strictEqual ( db . driver . opts . pool , true ) ;
269+ should . strictEqual ( db . driver . opts . debug , true ) ;
270+ done ( ) ;
271+ } ) ;
272+ } ) ;
273+
274+ it ( "should understand pool `'1'` from query string" , function ( done ) {
275+ var connString = common . getConnectionString ( ) + "debug=1&pool=1" ;
276+ ORM . connect ( connString , function ( err , db ) {
277+ should . not . exist ( err ) ;
278+ should . strictEqual ( db . driver . opts . pool , true ) ;
279+ should . strictEqual ( db . driver . opts . debug , true ) ;
280+ done ( ) ;
281+ } ) ;
282+ } ) ;
283+
284+ it ( "should understand pool `false` from query options" , function ( done ) {
285+ var connOpts = _ . extend ( common . getConfig ( ) , {
286+ protocol : common . protocol ( ) ,
287+ query : {
288+ pool : false , debug : false
289+ }
290+ } ) ;
291+ ORM . connect ( connOpts , function ( err , db ) {
292+ should . not . exist ( err ) ;
293+ should . strictEqual ( db . driver . opts . pool , false ) ;
294+ should . strictEqual ( db . driver . opts . debug , false ) ;
295+ done ( ) ;
296+ } ) ;
297+ } ) ;
298+
299+ it ( "should understand pool `true` from query options" , function ( done ) {
300+ var connOpts = _ . extend ( common . getConfig ( ) , {
301+ protocol : common . protocol ( ) ,
302+ query : {
303+ pool : true , debug : true
304+ }
305+ } ) ;
306+ ORM . connect ( connOpts , function ( err , db ) {
307+ should . not . exist ( err ) ;
308+ should . strictEqual ( db . driver . opts . pool , true ) ;
309+ should . strictEqual ( db . driver . opts . debug , true ) ;
247310 done ( ) ;
248311 } ) ;
249312 } ) ;
0 commit comments