Adjust delays on cancellation test -- unsure why this does not pass when run in the full suite

This commit is contained in:
Blake Watters 2013-05-13 09:41:44 -04:00
parent c2c3a656e7
commit 2c01759bda

View file

@ -53,7 +53,7 @@
- (void)testThatCancellationOfRequestOperationInvokesFailureCompletionBlock - (void)testThatCancellationOfRequestOperationInvokesFailureCompletionBlock
{ {
__block NSError *blockError = nil; __block NSError *blockError = nil;
NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"/delay/5" relativeToURL:AFNetworkingTestsBaseURL()]]; NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"/delay/1" relativeToURL:AFNetworkingTestsBaseURL()]];
AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request]; AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request];
[operation setCompletionBlockWithSuccess:nil failure:^(AFHTTPRequestOperation *operation, NSError *error) { [operation setCompletionBlockWithSuccess:nil failure:^(AFHTTPRequestOperation *operation, NSError *error) {
blockError = error; blockError = error;
@ -61,8 +61,9 @@
[operation start]; [operation start];
expect([operation isExecuting]).will.beTruthy(); expect([operation isExecuting]).will.beTruthy();
[operation cancel]; [operation cancel];
expect(operation.error).willNot.beNil();
expect(blockError).willNot.beNil(); expect(blockError).willNot.beNil();
expect(blockError.code).to.equal(NSURLErrorCancelled); expect(blockError.code).will.equal(NSURLErrorCancelled);
} }
- (void)testThat500StatusCodeInvokesFailureCompletionBlockWithErrorOnFailure - (void)testThat500StatusCodeInvokesFailureCompletionBlockWithErrorOnFailure