@@ -26,27 +26,31 @@ describe('server', () => {
26
26
} ) ;
27
27
28
28
it ( 'support http basic authentication with masterkey' , done => {
29
- request . get ( {
30
- url : 'http://localhost:8378/1/classes/TestObject' ,
31
- headers : {
32
- 'Authorization' : 'Basic ' + new Buffer ( 'test:' + 'test' ) . toString ( 'base64' )
33
- }
34
- } , ( error , response , body ) => {
35
- expect ( response . statusCode ) . toEqual ( 200 ) ;
36
- done ( ) ;
37
- } ) ;
29
+ reconfigureServer ( { appId : 'test' } ) . then ( ( ) => {
30
+ request . get ( {
31
+ url : 'http://localhost:8378/1/classes/TestObject' ,
32
+ headers : {
33
+ 'Authorization' : 'Basic ' + new Buffer ( 'test:' + 'test' ) . toString ( 'base64' )
34
+ }
35
+ } , ( error , response , body ) => {
36
+ expect ( response . statusCode ) . toEqual ( 200 ) ;
37
+ done ( ) ;
38
+ } ) ;
39
+ } )
38
40
} ) ;
39
41
40
42
it ( 'support http basic authentication with javascriptKey' , done => {
41
- request . get ( {
42
- url : 'http://localhost:8378/1/classes/TestObject' ,
43
- headers : {
44
- 'Authorization' : 'Basic ' + new Buffer ( 'test:javascript-key=' + 'test' ) . toString ( 'base64' )
45
- }
46
- } , ( error , response , body ) => {
47
- expect ( response . statusCode ) . toEqual ( 200 ) ;
48
- done ( ) ;
49
- } ) ;
43
+ reconfigureServer ( { appId : 'test' } ) . then ( ( ) => {
44
+ request . get ( {
45
+ url : 'http://localhost:8378/1/classes/TestObject' ,
46
+ headers : {
47
+ 'Authorization' : 'Basic ' + new Buffer ( 'test:javascript-key=' + 'test' ) . toString ( 'base64' )
48
+ }
49
+ } , ( error , response , body ) => {
50
+ expect ( response . statusCode ) . toEqual ( 200 ) ;
51
+ done ( ) ;
52
+ } ) ;
53
+ } )
50
54
} ) ;
51
55
52
56
it ( 'fails if database is unreachable' , done => {
0 commit comments