File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -334,6 +334,8 @@ export default class ParseObject {
334334 if ( ( attr === 'createdAt' || attr === 'updatedAt' ) &&
335335 typeof response [ attr ] === 'string' ) {
336336 changes [ attr ] = parseDate ( response [ attr ] ) ;
337+ } else if ( attr === 'ACL' ) {
338+ changes [ attr ] = new ParseACL ( response [ attr ] ) ;
337339 } else if ( attr !== 'objectId' ) {
338340 changes [ attr ] = decode ( response [ attr ] ) ;
339341 }
Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ jest.dontMock('../RESTController');
2626jest . dontMock ( '../TaskQueue' ) ;
2727jest . dontMock ( '../unique' ) ;
2828jest . dontMock ( '../unsavedChildren' ) ;
29+ jest . dontMock ( '../ParseACL' ) ;
2930
3031jest . dontMock ( './test_helpers/asyncHelper' ) ;
3132jest . dontMock ( './test_helpers/mockXHR' ) ;
@@ -728,6 +729,18 @@ describe('ParseObject', () => {
728729 expect ( p . op ( 'age' ) ) . toBe ( undefined ) ;
729730 } ) ;
730731
732+ it ( 'handles ACL when saved' , ( ) => {
733+ var p = new ParseObject ( 'Person' ) ;
734+
735+ p . _handleSaveResponse ( {
736+ ACL : { }
737+ } , 201 ) ;
738+
739+ var acl = p . getACL ( ) ;
740+ expect ( acl ) . not . toEqual ( null ) ;
741+ expect ( acl instanceof ParseACL ) . toBe ( true ) ;
742+ } ) ;
743+
731744 it ( 'replaces a local id with a real one when saved' , ( ) => {
732745 var p = new ParseObject ( 'Person' ) ;
733746 p . set ( 'age' , 34 ) ;
You can’t perform that action at this time.
0 commit comments