@@ -4,15 +4,20 @@ describe('client module', function() {
44
55 it ( 'should expose some of the main object types' , function ( ) {
66 var Pipedrive = require ( './..' ) ,
7- pipedrive = new Pipedrive . Client ( 'apitoken' ) ;
7+ pipedrive = new Pipedrive . Client ( 'apitoken' ) ,
8+ blueprint = require ( './../lib/blueprint' ) ;
89
9- should ( pipedrive . Deals ) . be . an . Object ( ) ;
10- should ( pipedrive . Persons ) . be . an . Object ( ) ;
11- should ( pipedrive . Organizations ) . be . an . Object ( ) ;
12- should ( pipedrive . Activities ) . be . an . Object ( ) ;
13- should ( pipedrive . Products ) . be . an . Object ( ) ;
14- should ( pipedrive . Files ) . be . an . Object ( ) ;
15- should ( pipedrive . Users ) . be . an . Object ( ) ;
10+ // iterate through all top level objects which should be exposed, e.g. pipedrive.Deals, ...
11+ blueprint . apiObjects . forEach ( function ( obj ) {
12+ should ( pipedrive [ obj . substr ( 0 , 1 ) . toUpperCase ( ) + obj . substr ( 1 ) ] ) . be . an . Object ( ) ;
13+ } ) ;
14+ } ) ;
15+
16+ it ( 'should expose .on() listener in strict mode' , function ( ) {
17+ var Pipedrive = require ( './..' ) ,
18+ pipedrive = new Pipedrive . Client ( 'apitoken' , { strictMode : true } ) ;
19+
20+ should ( pipedrive . on ) . be . a . Function ( ) ;
1621 } ) ;
1722
1823} ) ;
0 commit comments