@@ -9,7 +9,7 @@ require('sinon-as-promised');
99chai . use ( require ( 'sinon-chai' ) ) ;
1010chai . use ( require ( 'chai-as-promised' ) ) ;
1111
12- describe ( 'Message Events Library' , function ( ) {
12+ describe ( 'Events Library' , function ( ) {
1313 let client , events , callback ;
1414
1515 beforeEach ( function ( ) {
@@ -42,7 +42,7 @@ describe('Message Events Library', function() {
4242 to : '2016-11-14T16:15' ,
4343 transmission_ids : '65832150921904138'
4444 } ;
45- return events . message . search ( options , callback )
45+ return events . searchMessage ( options , callback )
4646 . then ( function ( ) {
4747 Object . keys ( options ) . forEach ( function ( key ) {
4848 expect ( client . get . firstCall . args [ 0 ] . qs ) . to . have . property ( key ) . and . equal ( options [ key ] ) ;
@@ -65,7 +65,7 @@ describe('Message Events Library', function() {
6565 per_page : 5 ,
6666 timezone : 'America/New_York'
6767 } ;
68- return events . message . search ( arroptions )
68+ return events . searchMessage ( arroptions )
6969 . then ( function ( ) {
7070 Object . keys ( arroptions ) . forEach ( function ( key ) {
7171 var opt = arroptions [ key ]
@@ -78,58 +78,5 @@ describe('Message Events Library', function() {
7878 } ) ;
7979 } ) ;
8080 } ) ;
81-
82- describe ( 'Ingest Tests' , function ( ) {
83- describe ( 'search Method' , function ( ) {
84- it ( 'should call client get method with the appropriate parameters' , function ( ) {
85- var options = {
86- events : 'success,error' ,
87- event_ids : '1169451c-0958-4704-a89d-538d3ba55f09,0109c92a-1b3d-4ba2-a300-d057de905305' ,
88- from : '2015-11-14T16:15' ,
89- batch_ids : '0a0b1358-0293-410d-1b78-e6ac3922a87,38cd32c7-2677-4602-a0a5-a25312c006d4' ,
90- retryable : true ,
91- cursor : 'initial' ,
92- page : 1 ,
93- per_page : 5 ,
94- timezone : 'America/New_York' ,
95- to : '2016-11-14T16:15' ,
96- subaccounts : '123,456'
97- } ;
98- return events . message . search ( options , callback )
99- . then ( function ( ) {
100- Object . keys ( options ) . forEach ( function ( key ) {
101- expect ( client . get . firstCall . args [ 0 ] . qs ) . to . have . property ( key ) . and . equal ( options [ key ] ) ;
102- } ) ;
103- expect ( client . get . firstCall . args [ 1 ] ) . to . equal ( callback ) ;
104- } ) ;
105- } ) ;
106-
107- it ( 'should accept arrays as parameters where appropriate' , function ( ) {
108- var arroptions = {
109- events : [ 'success' , 'error' ] ,
110- event_ids : [ '1169451c-0958-4704-a89d-538d3ba55f09' , '0109c92a-1b3d-4ba2-a300-d057de905305' ] ,
111- from : '2015-11-14T16:15' ,
112- batch_ids : [ '0a0b1358-0293-410d-1b78-e6ac3922a87' , '38cd32c7-2677-4602-a0a5-a25312c006d4' ] ,
113- retryable : true ,
114- cursor : 'initial' ,
115- page : 1 ,
116- per_page : 5 ,
117- timezone : 'America/New_York' ,
118- to : '2016-11-14T16:15' ,
119- subaccounts : [ '123' , '456' ]
120- } ;
121- return events . message . search ( arroptions )
122- . then ( function ( ) {
123- Object . keys ( arroptions ) . forEach ( function ( key ) {
124- var opt = arroptions [ key ]
125- , firstCallQS = client . get . firstCall . args [ 0 ] . qs ;
126- if ( Array . isArray ( opt ) ) {
127- expect ( firstCallQS ) . to . have . property ( key ) . and . equal ( opt . toString ( ) ) ;
128- }
129- } ) ;
130- } ) ;
131- } ) ;
132- } ) ;
133- } )
13481
13582} ) ;
0 commit comments