Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // 1 - Create a new user so we can upload patches
- XCTestExpectation *expectation1 = [self expectationWithDescription:@"createUser timed out (1)"];
- [[ChuckPadSocial sharedInstance] createUser:user.username email:user.email password:user.password callback:^(BOOL succeeded, NSError *error) {
- [self doPostAuthAssertChecks:user];
- [expectation1 fulfill];
- }];
- [self waitForExpectations];
- // 2 - Upload a new patch
- ChuckPadPatch *localPatch = [ChuckPadPatch generatePatch:@"demo0.ck"];
- XCTestExpectation *expectation2 = [self expectationWithDescription:@"uploadPatch timed out (2)"];
- [[ChuckPadSocial sharedInstance] uploadPatch:localPatch.name description:localPatch.patchDescription parent:-1 filename:localPatch.filename fileData:localPatch.fileData callback:^(BOOL succeeded, Patch *patch, NSError *error) {
- user.totalPatches++;
- XCTAssertTrue(succeeded);
- // Assert our username and owner username of patch match and once we confirm that is the case, update our local
- // user object with its user id.
- XCTAssertTrue([patch.creatorUsername isEqualToString:user.username]);
- [user updateUserId:patch.creatorId];
- [self assertPatch:patch localPatch:localPatch isConsistentForUser:user];
- [expectation2 fulfill];
- }];
- [self waitForExpectations];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement