@@ -30,22 +30,22 @@ describe('api/accessKeys/accessKeys.test.js', function() {
3030 it ( 'should create accessKeys successful' , function ( done ) {
3131 request . post ( `/accessKeys` )
3232 . set ( 'Authorization' , `Basic ${ authToken } ` )
33- . send ( { createdBy : 'tablee' , friendlyName : friendlyName , isSession : false , ttl : 30 * 24 * 60 * 60 } )
33+ . send ( { createdBy : 'tablee' , friendlyName : friendlyName , ttl : 30 * 24 * 60 * 60 } )
3434 . end ( function ( err , res ) {
3535 should . not . exist ( err ) ;
3636 res . status . should . equal ( 200 ) ;
3737 var rs = JSON . parse ( res . text ) ;
3838 rs . should . have . properties ( 'accessKey' ) ;
3939 rs . accessKey . should . have . properties ( [ 'name' , 'createdTime' , 'createdBy' ,
40- 'expires' , 'isSession' , ' description', 'friendlyName' ] ) ;
40+ 'expires' , 'description' , 'friendlyName' ] ) ;
4141 done ( ) ;
4242 } ) ;
4343 } ) ;
4444
4545 it ( 'should not create accessKeys successful when friendlyName exist' , function ( done ) {
4646 request . post ( `/accessKeys` )
4747 . set ( 'Authorization' , `Basic ${ authToken } ` )
48- . send ( { createdBy : 'tablee' , friendlyName : friendlyName , isSession : true , ttl : 30 * 24 * 60 * 60 } )
48+ . send ( { createdBy : 'tablee' , friendlyName : friendlyName , ttl : 30 * 24 * 60 * 60 } )
4949 . end ( function ( err , res ) {
5050 should . not . exist ( err ) ;
5151 res . status . should . equal ( 406 ) ;
@@ -68,84 +68,13 @@ describe('api/accessKeys/accessKeys.test.js', function() {
6868 rs . accessKeys . should . be . an . instanceOf ( Array ) ;
6969 rs . accessKeys . should . matchEach ( function ( it ) {
7070 return it . should . have . properties ( [ 'name' , 'createdTime' , 'createdBy' ,
71- 'expires' , 'isSession' , ' description', 'friendlyName' ] ) ;
71+ 'expires' , 'description' , 'friendlyName' ] ) ;
7272 } ) ;
7373 done ( ) ;
7474 } ) ;
7575 } ) ;
7676 } ) ;
7777
78- describe ( 'modify accessKeys' , function ( done ) {
79- it ( 'should modify accessKeys add ttl successful' , function ( done ) {
80- request . patch ( `/accessKeys/${ encodeURI ( friendlyName ) } ` )
81- . set ( 'Authorization' , `Basic ${ authToken } ` )
82- . send ( { ttl : 7 * 24 * 60 * 60 * 1000 } )
83- . end ( function ( err , res ) {
84- should . not . exist ( err ) ;
85- res . status . should . equal ( 200 ) ;
86- var rs = JSON . parse ( res . text ) ;
87- rs . should . have . properties ( 'accessKey' ) ;
88- rs . accessKey . should . have . properties ( [ 'name' , 'createdTime' , 'createdBy' ,
89- 'expires' , 'isSession' , 'description' , 'friendlyName' ] ) ;
90- done ( ) ;
91- } ) ;
92- } ) ;
93-
94- it ( 'should modify accessKeys substact ttl successful' , function ( done ) {
95- request . patch ( `/accessKeys/${ encodeURI ( friendlyName ) } ` )
96- . set ( 'Authorization' , `Basic ${ authToken } ` )
97- . send ( { ttl : - 7 * 24 * 60 * 60 * 1000 } )
98- . end ( function ( err , res ) {
99- should . not . exist ( err ) ;
100- res . status . should . equal ( 200 ) ;
101- var rs = JSON . parse ( res . text ) ;
102- rs . should . have . properties ( 'accessKey' ) ;
103- rs . accessKey . should . have . properties ( [ 'name' , 'createdTime' , 'createdBy' ,
104- 'expires' , 'isSession' , 'description' , 'friendlyName' ] ) ;
105- done ( ) ;
106- } ) ;
107- } ) ;
108-
109- it ( 'should not modify accessKeys friendlyName successful when friendlyName exists' , function ( done ) {
110- request . patch ( `/accessKeys/${ encodeURI ( friendlyName ) } ` )
111- . set ( 'Authorization' , `Basic ${ authToken } ` )
112- . send ( { friendlyName : friendlyName } )
113- . end ( function ( err , res ) {
114- should . not . exist ( err ) ;
115- res . status . should . equal ( 406 ) ;
116- res . text . should . equal ( `The access key "${ friendlyName } " already exists.` ) ;
117- done ( ) ;
118- } ) ;
119- } ) ;
120-
121- it ( 'should not modify accessKeys friendlyName successful when friendlyName invalid' , function ( done ) {
122- request . patch ( `/accessKeys/${ encodeURI ( newFriendlyName ) } ` )
123- . set ( 'Authorization' , `Basic ${ authToken } ` )
124- . send ( { friendlyName : newFriendlyName } )
125- . end ( function ( err , res ) {
126- should . not . exist ( err ) ;
127- res . status . should . equal ( 406 ) ;
128- res . text . should . equal ( `The access key "${ newFriendlyName } " does not exist.` ) ;
129- done ( ) ;
130- } ) ;
131- } ) ;
132-
133- it ( 'should modify accessKeys friendlyName successful' , function ( done ) {
134- request . patch ( `/accessKeys/${ encodeURI ( friendlyName ) } ` )
135- . set ( 'Authorization' , `Basic ${ authToken } ` )
136- . send ( { friendlyName : newFriendlyName } )
137- . end ( function ( err , res ) {
138- should . not . exist ( err ) ;
139- res . status . should . equal ( 200 ) ;
140- var rs = JSON . parse ( res . text ) ;
141- rs . should . have . properties ( 'accessKey' ) ;
142- rs . accessKey . should . have . properties ( [ 'name' , 'createdTime' , 'createdBy' ,
143- 'expires' , 'isSession' , 'description' , 'friendlyName' ] ) ;
144- done ( ) ;
145- } ) ;
146- } ) ;
147- } ) ;
148-
14978 describe ( 'delete accessKeys' , function ( done ) {
15079 it ( 'should delete accessKeys successful' , function ( done ) {
15180 request . delete ( `/accessKeys/${ encodeURI ( newFriendlyName ) } ` )
0 commit comments