Permalink
Browse files

Fix ETag header access to work in iOS 4

NSURLResponse's header dictionary is case-sensitive in iOS 4, but not in iOS 5.

Change-Id: If262b09fc157487c391cbd9e32deda1c301344ec
Reviewed-on: http://review.couchbase.org/9213
Reviewed-by: Chris Anderson <jchris@couchbase.com>
Tested-by: Jens Alfke <jens@couchbase.com>
  • Loading branch information...
1 parent 95d6844 commit 5f8491401a5bb4d5147be07305ea042e30b51cb5 @snej snej committed Aug 24, 2011
Showing with 6 additions and 6 deletions.
  1. +6 −6 EmptyApp/Tests/EmptyAppTests.m
@@ -132,20 +132,20 @@ - (void)test3_UpdateViews {
NSDictionary* headers;
[self send: @"GET" toPath: @"/unittestdb/_design/updateviews/_view/simple"
body: nil responseHeaders: &headers];
- NSLog(@"ETag: %@", [headers objectForKey: @"ETag"]);
- NSString* eTag = [headers objectForKey: @"ETag"];
+ NSString* eTag = [headers objectForKey: @"Etag"];
+ NSLog(@"ETag: %@", eTag);
STAssertNotNil(eTag, nil);
[self send: @"GET" toPath: @"/unittestdb/_design/updateviews/_view/simple"
body: nil responseHeaders: &headers];
- NSLog(@"ETag: %@", [headers objectForKey: @"ETag"]);
- STAssertEqualObjects([headers objectForKey: @"ETag"], eTag, @"View eTag isn't stable");
+ NSLog(@"ETag: %@", [headers objectForKey: @"Etag"]);
+ STAssertEqualObjects([headers objectForKey: @"Etag"], eTag, @"View eTag isn't stable");
[self send: @"PUT" toPath: @"/unittestdb/doc2" body: @"{\"txt\":\"KTHXBYE\"}"];
[self send: @"GET" toPath: @"/unittestdb/_design/updateviews/_view/simple"
body: nil responseHeaders: &headers];
- NSLog(@"ETag: %@", [headers objectForKey: @"ETag"]);
- STAssertFalse([eTag isEqualToString: [headers objectForKey: @"ETag"]], @"View didn't update");
+ NSLog(@"ETag: %@", [headers objectForKey: @"Etag"]);
+ STAssertFalse([eTag isEqualToString: [headers objectForKey: @"Etag"]], @"View didn't update");
}

0 comments on commit 5f84914

Please sign in to comment.