File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -29,8 +29,8 @@ - (void)testInstallationObjectIdCannotBeChanged {
29
29
PFAssertThrowsInvalidArgumentException (installation[@" objectId" ] = @" abc" );
30
30
}
31
31
32
- - (void )testReSaveInstallation {
33
-
32
+ - (void )testObjectNotFoundWhenSave {
33
+ # if TARGET_OS_IOS
34
34
// enable LDS
35
35
[[Parse _currentManager ]loadOfflineStoreWithOptions:0 ];
36
36
@@ -46,11 +46,18 @@ - (void)testReSaveInstallation {
46
46
47
47
BFTask *mockedTask = [BFTask taskWithError: [NSError errorWithDomain: @" " code: kPFErrorObjectNotFound userInfo: nil ]];
48
48
49
- OCMStub ([commandRunner runCommandAsync: [OCMArg any ] withOptions: PFCommandRunningOptionRetryIfFailed]).andReturn (mockedTask);
49
+ __block int callCount = 0 ;
50
+ OCMStub ([commandRunner runCommandAsync: [OCMArg any ] withOptions: PFCommandRunningOptionRetryIfFailed])
51
+ .andReturn (mockedTask)
52
+ .andDo (^(NSInvocation *invocation) {
53
+ callCount++;
54
+ });
50
55
51
56
installation.deviceToken = @" 11433856eed2f1285fb3aa11136718c1198ed5647875096952c66bf8cb976306" ;
52
57
[installation save ];
53
58
OCMVerifyAll (commandRunner);
59
+ XCTAssertEqual (2 , callCount);
60
+ #endif
54
61
}
55
62
56
63
- (void )testInstallationImmutableFieldsCannotBeChanged {
You can’t perform that action at this time.
0 commit comments