Added test for text encoding bug fix
Reinstated temporary file removal test
Showing
1 changed file
with
9 additions
and
2 deletions
@@ -74,6 +74,13 @@ | @@ -74,6 +74,13 @@ | ||
74 | [request start]; | 74 | [request start]; |
75 | BOOL success = [request responseEncoding] == [request defaultResponseEncoding]; | 75 | BOOL success = [request responseEncoding] == [request defaultResponseEncoding]; |
76 | GHAssertTrue(success,[NSString stringWithFormat:@"Failed to use the default string encoding"]); | 76 | GHAssertTrue(success,[NSString stringWithFormat:@"Failed to use the default string encoding"]); |
77 | + | ||
78 | + // Will return a Content-Type header with charset in the middle of the value (Fix contributed by Roman Busyghin) | ||
79 | + url = [[[NSURL alloc] initWithString:@"http://allseeing-i.com/ASIHTTPRequest/tests/Character-Encoding/utf-16-with-type-header"] autorelease]; | ||
80 | + request = [[[ASIHTTPRequest alloc] initWithURL:url] autorelease]; | ||
81 | + [request start]; | ||
82 | + success = [request responseEncoding] == NSUnicodeStringEncoding; | ||
83 | + GHAssertTrue(success,[NSString stringWithFormat:@"Failed to parse the content type header correctly"]); | ||
77 | } | 84 | } |
78 | 85 | ||
79 | - (void)testTimeOut | 86 | - (void)testTimeOut |
@@ -136,8 +143,8 @@ | @@ -136,8 +143,8 @@ | ||
136 | NSString *tempPath = [request temporaryFileDownloadPath]; | 143 | NSString *tempPath = [request temporaryFileDownloadPath]; |
137 | GHAssertNotNil(tempPath,@"Failed to download file to temporary location"); | 144 | GHAssertNotNil(tempPath,@"Failed to download file to temporary location"); |
138 | 145 | ||
139 | - //BOOL success = (![[NSFileManager defaultManager] fileExistsAtPath:tempPath]); | 146 | + BOOL success = (![[NSFileManager defaultManager] fileExistsAtPath:tempPath]); |
140 | - //GHAssertTrue(success,@"Failed to remove file from temporary location"); | 147 | + GHAssertTrue(success,@"Failed to remove file from temporary location"); |
141 | 148 | ||
142 | #if TARGET_OS_IPHONE | 149 | #if TARGET_OS_IPHONE |
143 | UIImage *image = [[[UIImage alloc] initWithContentsOfFile:path] autorelease]; | 150 | UIImage *image = [[[UIImage alloc] initWithContentsOfFile:path] autorelease]; |
-
Please register or login to post a comment