@@ -35,23 +35,47 @@ describe('UsersService', () => {
3535 it ( 'grant role to a User' , ( ) => {
3636 const userId = 'userId' ;
3737 const roleId = 'admin' ;
38+ service . isProduction = true ;
3839
3940 service . grantRole ( userId , roleId ) . subscribe ( ) ;
4041
4142 const grantRoleRequest = httpMock . expectOne ( `${ service . baseUrl } /${ userId } /roles/${ roleId } /grant` ) ;
4243 expect ( grantRoleRequest . request . method ) . toBe ( 'POST' ) ;
4344 } ) ;
4445
46+ it ( 'grant role to a User locally' , ( ) => {
47+ const userId = 'userId' ;
48+ const roleId = 'admin' ;
49+ service . isProduction = false ;
50+
51+ service . grantRole ( userId , roleId ) . subscribe ( ) ;
52+
53+ const grantRoleRequest = httpMock . expectOne ( `${ service . baseUrl } /${ userId } /${ roleId } /grant` ) ;
54+ expect ( grantRoleRequest . request . method ) . toBe ( 'POST' ) ;
55+ } ) ;
56+
4557 it ( 'revoke role to a User' , ( ) => {
4658 const userId = 'userId' ;
4759 const roleId = 'admin' ;
60+ service . isProduction = true ;
4861
4962 service . revokeRole ( userId , roleId ) . subscribe ( ) ;
5063
5164 const grantRoleRequest = httpMock . expectOne ( `${ service . baseUrl } /${ userId } /roles/${ roleId } /revoke` ) ;
5265 expect ( grantRoleRequest . request . method ) . toBe ( 'POST' ) ;
5366 } ) ;
5467
68+ it ( 'revoke role to a User locally' , ( ) => {
69+ const userId = 'userId' ;
70+ const roleId = 'admin' ;
71+ service . isProduction = false ;
72+
73+ service . revokeRole ( userId , roleId ) . subscribe ( ) ;
74+
75+ const grantRoleRequest = httpMock . expectOne ( `${ service . baseUrl } /${ userId } /${ roleId } /revoke` ) ;
76+ expect ( grantRoleRequest . request . method ) . toBe ( 'POST' ) ;
77+ } ) ;
78+
5579 it ( 'add user to group' , ( ) => {
5680 const userId = 'userId' ;
5781 const group = 'admin' ;
0 commit comments