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 {
334
334
if ( ( attr === 'createdAt' || attr === 'updatedAt' ) &&
335
335
typeof response [ attr ] === 'string' ) {
336
336
changes [ attr ] = parseDate ( response [ attr ] ) ;
337
+ } else if ( attr === 'ACL' ) {
338
+ changes [ attr ] = new ParseACL ( response [ attr ] ) ;
337
339
} else if ( attr !== 'objectId' ) {
338
340
changes [ attr ] = decode ( response [ attr ] ) ;
339
341
}
Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ jest.dontMock('../RESTController');
26
26
jest . dontMock ( '../TaskQueue' ) ;
27
27
jest . dontMock ( '../unique' ) ;
28
28
jest . dontMock ( '../unsavedChildren' ) ;
29
+ jest . dontMock ( '../ParseACL' ) ;
29
30
30
31
jest . dontMock ( './test_helpers/asyncHelper' ) ;
31
32
jest . dontMock ( './test_helpers/mockXHR' ) ;
@@ -728,6 +729,18 @@ describe('ParseObject', () => {
728
729
expect ( p . op ( 'age' ) ) . toBe ( undefined ) ;
729
730
} ) ;
730
731
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
+
731
744
it ( 'replaces a local id with a real one when saved' , ( ) => {
732
745
var p = new ParseObject ( 'Person' ) ;
733
746
p . set ( 'age' , 34 ) ;
You can’t perform that action at this time.
0 commit comments