File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,8 @@ - (void)testObjectNotFoundWhenSave {
3333#if TARGET_OS_IOS
3434 // enable LDS
3535 [[Parse _currentManager ]loadOfflineStoreWithOptions:0 ];
36+ PFOfflineStore *offlineStoreSpy = PFPartialMock ([Parse _currentManager ].offlineStore );
37+ [Parse _currentManager ].offlineStore = offlineStoreSpy;
3638
3739 // create and save installation
3840 PFInstallation *installation = [PFInstallation currentInstallation ];
@@ -44,7 +46,7 @@ - (void)testObjectNotFoundWhenSave {
4446 id commandRunner = PFStrictProtocolMock (@protocol (PFCommandRunning));
4547 [Parse _currentManager ].commandRunner = commandRunner;
4648
47- BFTask *mockedTask = [BFTask taskWithError: [NSError errorWithDomain: @" " code: kPFErrorObjectNotFound userInfo: nil ]];
49+ BFTask *mockedTask = [BFTask taskWithError: [NSError errorWithDomain: @" Object Not Found " code: kPFErrorObjectNotFound userInfo: nil ]];
4850
4951 __block int callCount = 0 ;
5052 OCMStub ([commandRunner runCommandAsync: [OCMArg any ] withOptions: PFCommandRunningOptionRetryIfFailed])
@@ -57,6 +59,8 @@ - (void)testObjectNotFoundWhenSave {
5759 [installation save ];
5860 OCMVerifyAll (commandRunner);
5961 XCTAssertEqual (2 , callCount);
62+ OCMVerify ([offlineStoreSpy updateObjectIdForObject: installation oldObjectId: nil newObjectId: @" abc" ]);
63+ OCMVerify ([offlineStoreSpy updateObjectIdForObject: installation oldObjectId: @" abc" newObjectId: nil ]);
6064#endif
6165}
6266
You can’t perform that action at this time.
0 commit comments