@@ -40,21 +40,21 @@ describe('Security user methods', function () {
4040 }
4141 } ;
4242
43- describe ( '#getUser ' , function ( ) {
43+ describe ( '#fetchUser ' , function ( ) {
4444 beforeEach ( function ( ) {
4545 kuzzle = new Kuzzle ( 'foo' , { defaultIndex : 'bar' } ) ;
4646 kuzzle . query = queryStub ;
4747 error = null ;
4848 result = { result : { _id : 'foobar' , _source : { profileIds : [ 'profile' ] } } } ;
4949 expectedQuery = {
50- action : 'getUser ' ,
50+ action : 'fetchUser ' ,
5151 controller : 'security' ,
5252 _id : 'foobar'
5353 } ;
5454 } ) ;
5555
5656 it ( 'should send the right query to Kuzzle' , function ( done ) {
57- should ( kuzzle . security . getUser ( result . result . _id , function ( err , res ) {
57+ should ( kuzzle . security . fetchUser ( result . result . _id , function ( err , res ) {
5858 should ( err ) . be . null ( ) ;
5959 should ( res ) . be . instanceof ( User ) ;
6060
@@ -66,7 +66,7 @@ describe('Security user methods', function () {
6666 } ) ;
6767
6868 it ( 'should send the right query to Kuzzle with id as profile' , function ( done ) {
69- should ( kuzzle . security . getUser ( result . result . _id , function ( err , res ) {
69+ should ( kuzzle . security . fetchUser ( result . result . _id , function ( err , res ) {
7070 should ( err ) . be . null ( ) ;
7171 should ( res ) . be . instanceof ( User ) ;
7272
@@ -78,18 +78,18 @@ describe('Security user methods', function () {
7878 } ) ;
7979
8080 it ( 'should raise an error if no callback is provided' , function ( ) {
81- should ( function ( ) { kuzzle . security . getUser ( 'test' ) ; } ) . throw ( Error ) ;
81+ should ( function ( ) { kuzzle . security . fetchUser ( 'test' ) ; } ) . throw ( Error ) ;
8282 } ) ;
8383
8484 it ( 'should throw an error when no id is provided' , function ( ) {
85- should ( function ( ) { kuzzle . security . getUser ( null , function ( ) { } ) ; } ) . throw ( Error ) ;
85+ should ( function ( ) { kuzzle . security . fetchUser ( null , function ( ) { } ) ; } ) . throw ( Error ) ;
8686 } ) ;
8787
8888 it ( 'should call the callback with an error if one occurs' , function ( done ) {
8989 error = 'error' ;
9090 this . timeout ( 50 ) ;
9191
92- kuzzle . security . getUser ( 'foobar' , function ( err , res ) {
92+ kuzzle . security . fetchUser ( 'foobar' , function ( err , res ) {
9393 should ( err ) . be . exactly ( 'error' ) ;
9494 should ( res ) . be . undefined ( ) ;
9595 done ( ) ;
0 commit comments