@@ -561,6 +561,63 @@ describe('schemas', () => {
561
561
} )
562
562
} ) ;
563
563
564
+ it ( 'lets you add fields to system schema' , done => {
565
+ request . post ( {
566
+ url : 'http://localhost:8378/1/schemas/_User' ,
567
+ headers : masterKeyHeaders ,
568
+ json : true
569
+ } , ( error , response , body ) => {
570
+ request . put ( {
571
+ url : 'http://localhost:8378/1/schemas/_User' ,
572
+ headers : masterKeyHeaders ,
573
+ json : true ,
574
+ body : {
575
+ fields : {
576
+ newField : { type : 'String' }
577
+ }
578
+ }
579
+ } , ( error , response , body ) => {
580
+ expect ( body ) . toEqual ( {
581
+ className : '_User' ,
582
+ fields : {
583
+ objectId : { type : 'String' } ,
584
+ updatedAt : { type : 'Date' } ,
585
+ createdAt : { type : 'Date' } ,
586
+ username : { type : 'String' } ,
587
+ password : { type : 'String' } ,
588
+ authData : { type : 'Object' } ,
589
+ email : { type : 'String' } ,
590
+ emailVerified : { type : 'Boolean' } ,
591
+ newField : { type : 'String' } ,
592
+ ACL : { type : 'ACL' }
593
+ }
594
+ } ) ;
595
+ request . get ( {
596
+ url : 'http://localhost:8378/1/schemas/_User' ,
597
+ headers : masterKeyHeaders ,
598
+ json : true
599
+ } , ( error , response , body ) => {
600
+ expect ( body ) . toEqual ( {
601
+ className : '_User' ,
602
+ fields : {
603
+ objectId : { type : 'String' } ,
604
+ updatedAt : { type : 'Date' } ,
605
+ createdAt : { type : 'Date' } ,
606
+ username : { type : 'String' } ,
607
+ password : { type : 'String' } ,
608
+ authData : { type : 'Object' } ,
609
+ email : { type : 'String' } ,
610
+ emailVerified : { type : 'Boolean' } ,
611
+ newField : { type : 'String' } ,
612
+ ACL : { type : 'ACL' }
613
+ }
614
+ } ) ;
615
+ done ( ) ;
616
+ } ) ;
617
+ } ) ;
618
+ } )
619
+ } ) ;
620
+
564
621
it ( 'lets you delete multiple fields and add fields' , done => {
565
622
var obj1 = hasAllPODobject ( ) ;
566
623
obj1 . save ( )
0 commit comments