@@ -56,6 +56,49 @@ describe('a GlobalConfig', () => {
56
56
} ) ;
57
57
} ) ;
58
58
59
+ it ( 'can add and retrive files' , ( done ) => {
60
+ request . put ( {
61
+ url : 'http://localhost:8378/1/config' ,
62
+ json : true ,
63
+ body : { params : { file : { __type : 'File' , name : 'name' , url : 'http://url' } } } ,
64
+ headers : {
65
+ 'X-Parse-Application-Id' : 'test' ,
66
+ 'X-Parse-Master-Key' : 'test'
67
+ }
68
+ } , ( error , response , body ) => {
69
+ expect ( response . statusCode ) . toEqual ( 200 ) ;
70
+ expect ( body . result ) . toEqual ( true ) ;
71
+ Parse . Config . get ( ) . then ( ( res ) => {
72
+ const file = res . get ( 'file' ) ;
73
+ expect ( file . name ( ) ) . toBe ( 'name' ) ;
74
+ expect ( file . url ( ) ) . toBe ( 'http://url' ) ;
75
+ done ( ) ;
76
+ } ) ;
77
+ } ) ;
78
+ } ) ;
79
+
80
+ it ( 'can add and retrive Geopoints' , ( done ) => {
81
+ const geopoint = new Parse . GeoPoint ( 10 , - 20 ) ;
82
+ request . put ( {
83
+ url : 'http://localhost:8378/1/config' ,
84
+ json : true ,
85
+ body : { params : { point : geopoint . toJSON ( ) } } ,
86
+ headers : {
87
+ 'X-Parse-Application-Id' : 'test' ,
88
+ 'X-Parse-Master-Key' : 'test'
89
+ }
90
+ } , ( error , response , body ) => {
91
+ expect ( response . statusCode ) . toEqual ( 200 ) ;
92
+ expect ( body . result ) . toEqual ( true ) ;
93
+ Parse . Config . get ( ) . then ( ( res ) => {
94
+ const point = res . get ( 'point' ) ;
95
+ expect ( point . latitude ) . toBe ( 10 ) ;
96
+ expect ( point . longitude ) . toBe ( - 20 ) ;
97
+ done ( ) ;
98
+ } ) ;
99
+ } ) ;
100
+ } ) ;
101
+
59
102
it ( 'properly handles delete op' , ( done ) => {
60
103
request . put ( {
61
104
url : 'http://localhost:8378/1/config' ,
0 commit comments