@@ -166,7 +166,7 @@ describe('KuzzleDataCollection methods', function () {
166166 } ;
167167
168168 queryScrollStub = function ( args , query , opts , callback ) {
169- should ( args . controller ) . be . exactly ( 'read ' ) ;
169+ should ( args . controller ) . be . exactly ( 'document ' ) ;
170170 should ( args . action ) . be . exactly ( 'scroll' ) ;
171171 should ( query . body . scroll ) . be . exactly ( options . scroll ) ;
172172 should ( query . body . scrollId ) . be . exactly ( scrollId ) ;
@@ -201,7 +201,7 @@ describe('KuzzleDataCollection methods', function () {
201201 } ;
202202
203203 queryScrollStub = function ( args , query , opts , callback ) {
204- should ( args . controller ) . be . exactly ( 'read ' ) ;
204+ should ( args . controller ) . be . exactly ( 'document ' ) ;
205205 should ( args . action ) . be . exactly ( 'scroll' ) ;
206206 should ( query . body . scrollId ) . be . exactly ( scrollId ) ;
207207 should ( opts ) . be . null ( ) ;
@@ -601,6 +601,13 @@ describe('KuzzleDataCollection methods', function () {
601601 beforeEach ( function ( ) {
602602 kuzzle = new Kuzzle ( 'foo' , { defaultIndex : 'bar' } ) ;
603603 emitted = false ;
604+ expectedQuery = {
605+ index : 'bar' ,
606+ collection : 'foo' ,
607+ action : 'get' ,
608+ controller : 'document' ,
609+ body : { }
610+ } ;
604611 } ) ;
605612
606613 it ( 'should forward the query to the search method' , function ( ) {
@@ -652,7 +659,7 @@ describe('KuzzleDataCollection methods', function () {
652659
653660 collection . fetchAllDocuments ( { from : 123 , size : 456 } , function ( ) { } ) ;
654661 should ( stub . calledOnce ) . be . true ( ) ;
655- should ( stub . calledWithMatch ( { from : 123 , size : 456 } ) ) . be . true ( ) ;
662+ should ( stub . calledWithMatch ( { } , { from : 123 , size : 456 } ) ) . be . true ( ) ;
656663 stub . restore ( ) ;
657664 } ) ;
658665
@@ -663,7 +670,8 @@ describe('KuzzleDataCollection methods', function () {
663670
664671 collection . fetchAllDocuments ( { scroll : '30s' } , function ( ) { } ) ;
665672 should ( stub . calledOnce ) . be . true ( ) ;
666- should ( stub . calledWithMatch ( { from : 0 , size : 1000 , scroll : '30s' } ) ) . be . true ( ) ;
673+ console . dir ( stub . firstCall . args , { depth : null } ) ;
674+ should ( stub . calledWith ( { } , { scroll : '30s' } , sinon . match . func ) ) . be . true ( ) ;
667675 stub . restore ( ) ;
668676 } ) ;
669677
0 commit comments