@@ -329,7 +329,7 @@ describe('TokenHandler integration', function() {
329329 } ) ;
330330
331331 it ( 'should not return custom attributes in a bearer token if the allowExtendedTokenAttributes is not set' , function ( ) {
332- const token = { accessToken : 'foo' , client : { } , refreshToken : 'bar' , scope : [ 'foobar ' ] , user : { } , foo : 'bar' } ;
332+ const token = { accessToken : 'foo' , client : { } , refreshToken : 'bar' , scope : [ 'baz ' ] , user : { } , foo : 'bar' } ;
333333 const model = {
334334 getClient : function ( ) { return { grants : [ 'password' ] } ; } ,
335335 getUser : function ( ) { return { } ; } ,
@@ -344,7 +344,7 @@ describe('TokenHandler integration', function() {
344344 username : 'foo' ,
345345 password : 'bar' ,
346346 grant_type : 'password' ,
347- scope : 'baz'
347+ scope : [ 'baz' ]
348348 } ,
349349 headers : { 'content-type' : 'application/x-www-form-urlencoded' , 'transfer-encoding' : 'chunked' } ,
350350 method : 'POST' ,
@@ -357,14 +357,14 @@ describe('TokenHandler integration', function() {
357357 should . exist ( response . body . access_token ) ;
358358 should . exist ( response . body . refresh_token ) ;
359359 should . exist ( response . body . token_type ) ;
360- should . exist ( response . body . scope ) ;
360+ response . body . scope . should . eql ( 'baz' ) ;
361361 should . not . exist ( response . body . foo ) ;
362362 } )
363363 . catch ( should . fail ) ;
364364 } ) ;
365365
366366 it ( 'should return custom attributes in a bearer token if the allowExtendedTokenAttributes is set' , function ( ) {
367- const token = { accessToken : 'foo' , client : { } , refreshToken : 'bar' , scope : [ 'foobar ' ] , user : { } , foo : 'bar' } ;
367+ const token = { accessToken : 'foo' , client : { } , refreshToken : 'bar' , scope : [ 'baz ' ] , user : { } , foo : 'bar' } ;
368368 const model = {
369369 getClient : function ( ) { return { grants : [ 'password' ] } ; } ,
370370 getUser : function ( ) { return { } ; } ,
@@ -392,7 +392,7 @@ describe('TokenHandler integration', function() {
392392 should . exist ( response . body . access_token ) ;
393393 should . exist ( response . body . refresh_token ) ;
394394 should . exist ( response . body . token_type ) ;
395- should . exist ( response . body . scope ) ;
395+ response . body . scope . should . eql ( 'baz' ) ;
396396 should . exist ( response . body . foo ) ;
397397 } )
398398 . catch ( should . fail ) ;
0 commit comments