From 2c01759bda16e4016c957bcf9cc0c174944dd4ff Mon Sep 17 00:00:00 2001 From: Blake Watters Date: Mon, 13 May 2013 09:41:44 -0400 Subject: [PATCH] Adjust delays on cancellation test -- unsure why this does not pass when run in the full suite --- Tests/AFHTTPRequestOperationTests.m | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Tests/AFHTTPRequestOperationTests.m b/Tests/AFHTTPRequestOperationTests.m index 029ce9c..1350e31 100644 --- a/Tests/AFHTTPRequestOperationTests.m +++ b/Tests/AFHTTPRequestOperationTests.m @@ -53,7 +53,7 @@ - (void)testThatCancellationOfRequestOperationInvokesFailureCompletionBlock { __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]; [operation setCompletionBlockWithSuccess:nil failure:^(AFHTTPRequestOperation *operation, NSError *error) { blockError = error; @@ -61,8 +61,9 @@ [operation start]; expect([operation isExecuting]).will.beTruthy(); [operation cancel]; + expect(operation.error).willNot.beNil(); expect(blockError).willNot.beNil(); - expect(blockError.code).to.equal(NSURLErrorCancelled); + expect(blockError.code).will.equal(NSURLErrorCancelled); } - (void)testThat500StatusCodeInvokesFailureCompletionBlockWithErrorOnFailure