Browse files

Added new test to ensure that URLWithString:relativeToURL: is working…

… with a completely unrelated domain redirect
  • Loading branch information...
1 parent 4a8954f commit ede6f31cbfa41de4e25e64300bfa73c7ed3e85fa @pokeb committed Jul 13, 2009
Showing with 9 additions and 0 deletions.
  1. +1 −0 Classes/Tests/ASIHTTPRequestTests.h
  2. +8 −0 Classes/Tests/ASIHTTPRequestTests.m
View
1 Classes/Tests/ASIHTTPRequestTests.h
@@ -35,4 +35,5 @@
- (void)testSSL;
- (void)testRedirectPreservesSession;
- (void)testTooMuchRedirection;
+- (void)testRedirectToNewDomain;
@end
View
8 Classes/Tests/ASIHTTPRequestTests.m
@@ -659,4 +659,12 @@ - (void)testTooMuchRedirection
GHAssertTrue(success,@"Generated the wrong error for a redirection loop");
}
+- (void)testRedirectToNewDomain
+{
+ ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:[NSURL URLWithString:@"http://allseeing-i.com/ASIHTTPRequest/tests/redirect_to_new_domain"]];
+ [request start];
+ BOOL success = [[[request url] absoluteString] isEqualTo:@"http://www.apple.com/"];
+ GHAssertTrue(success,@"Failed to redirect to a different domain");
+}
+
@end

0 comments on commit ede6f31

Please sign in to comment.