Fix test breakage when your ISP returns a custom HTTP response page for an invalid host

This commit is contained in:
Blake Watters
2013-01-07 14:19:57 -05:00
parent a21213e9c1
commit 3d1bb617e7

View File

@@ -99,7 +99,9 @@
[operationQueue addOperation:requestOperation];
[operationQueue waitUntilAllOperationsAreFinished];
expect([requestOperation.error code]).to.equal(NSURLErrorCannotFindHost);
// NOTE: If your ISP provides a redirect page for unknown hosts, you'll get a `NSURLErrorCannotDecodeContentData`
NSArray *validErrorCodes = @[ @(NSURLErrorCannotDecodeContentData), @(NSURLErrorCannotFindHost) ];
assertThat(validErrorCodes, hasItem(@([requestOperation.error code])));
}
- (void)testSendingAnObjectRequestOperationToAnBrokenURL
{