Permalink
Browse files

* Made the tests pass. Mostly involved updating the Delete status cod…

…e from 202 to 200
  • Loading branch information...
objectiveous committed Jan 9, 2009
1 parent 11dd6f2 commit 08e1c5bf4206a8906aba3197c791bd97d8cc5c95
Showing with 1,433 additions and 139 deletions.
  1. +3 −1 .gitignore
  2. +4 −2 Classes/SBCouchDatabase.m
  3. +3 −2 Classes/SBCouchServer.m
  4. +6 −12 CouchObjC.xcodeproj/project.pbxproj
  5. +1,363 −50 CouchObjC.xcodeproj/robevans.pbxuser
  6. +4 −1 README
  7. +0 −18 Tests/Database.h
  8. +24 −9 Tests/Database.m
  9. +0 −16 Tests/Document.h
  10. +7 −1 Tests/Document.m
  11. +0 −16 Tests/Server.h
  12. +19 −11 Tests/Server.m
View
@@ -1,2 +1,4 @@
+.gitignore~
build/
-vendor/JSON/build/
+vendor/JSON/build/
+CouchObjC.xcodeproj/robevans.pbxuser
@@ -153,8 +153,10 @@ - (SBCouchResponse*)deleteDocument:(NSDictionary*)doc
NSData *data = [NSURLConnection sendSynchronousRequest:request
returningResponse:&response
error:&error];
-
- if (202 == [response statusCode]) {
+ // 412 == conflict
+ // 200 == OK
+ NSLog(@"response code from the delete %i", [response statusCode]);
+ if (200 == [response statusCode]) {
NSString *json = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
return [[SBCouchResponse alloc] initWithDictionary:[json JSONValue]];
}
View
@@ -112,8 +112,9 @@ - (BOOL)deleteDatabase:(NSString*)db
(void)[NSURLConnection sendSynchronousRequest:request
returningResponse:&response
error:&error];
-
- return 202 == [response statusCode];
+
+ // http://wiki.apache.org/couchdb/Breaking_changes
+ return 200 == [response statusCode];
}
- (NSArray*)listDatabases
@@ -9,21 +9,21 @@
/* Begin PBXBuildFile section */
5315EE5D0D940717001E3B2E /* SBCouchServer.h in Headers */ = {isa = PBXBuildFile; fileRef = 5315EE5B0D940717001E3B2E /* SBCouchServer.h */; settings = {ATTRIBUTES = (Private, ); }; };
5315EE5E0D940717001E3B2E /* SBCouchServer.m in Sources */ = {isa = PBXBuildFile; fileRef = 5315EE5C0D940717001E3B2E /* SBCouchServer.m */; };
- 5315EE790D940818001E3B2E /* Server.m in Sources */ = {isa = PBXBuildFile; fileRef = 5315EE780D940818001E3B2E /* Server.m */; };
5315EE890D941077001E3B2E /* CouchObjC.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8DC2EF5B0486A6940098B216 /* CouchObjC.framework */; };
5315EE8B0D941085001E3B2E /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0867D69BFE84028FC02AAC07 /* Foundation.framework */; };
5315EEB20D94178E001E3B2E /* JSON.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5315EEAB0D941786001E3B2E /* JSON.framework */; };
53905A100D9429B4003D62CE /* NSDictionary+CouchObjC.h in Headers */ = {isa = PBXBuildFile; fileRef = 53905A0E0D9429B4003D62CE /* NSDictionary+CouchObjC.h */; settings = {ATTRIBUTES = (Private, ); }; };
53905A110D9429B4003D62CE /* NSDictionary+CouchObjC.m in Sources */ = {isa = PBXBuildFile; fileRef = 53905A0F0D9429B4003D62CE /* NSDictionary+CouchObjC.m */; };
- 53905A140D9429CE003D62CE /* Document.m in Sources */ = {isa = PBXBuildFile; fileRef = 53905A130D9429CE003D62CE /* Document.m */; };
- 53905A510D9430CD003D62CE /* Database.m in Sources */ = {isa = PBXBuildFile; fileRef = 53905A500D9430CD003D62CE /* Database.m */; };
53905A580D943BD5003D62CE /* SBCouchDatabase.h in Headers */ = {isa = PBXBuildFile; fileRef = 53905A560D943BD5003D62CE /* SBCouchDatabase.h */; settings = {ATTRIBUTES = (Private, ); }; };
53905A590D943BD5003D62CE /* SBCouchDatabase.m in Sources */ = {isa = PBXBuildFile; fileRef = 53905A570D943BD5003D62CE /* SBCouchDatabase.m */; };
53905A830D943DF8003D62CE /* CouchObjC.h in Headers */ = {isa = PBXBuildFile; fileRef = 53905A820D943DF8003D62CE /* CouchObjC.h */; settings = {ATTRIBUTES = (Public, ); }; };
53A9DB1D0D94583C0019A94C /* SBCouchResponse.h in Headers */ = {isa = PBXBuildFile; fileRef = 53A9DB1B0D94583C0019A94C /* SBCouchResponse.h */; settings = {ATTRIBUTES = (Private, ); }; };
53A9DB1E0D94583C0019A94C /* SBCouchResponse.m in Sources */ = {isa = PBXBuildFile; fileRef = 53A9DB1C0D94583C0019A94C /* SBCouchResponse.m */; };
53A9DBBC0D947A2F0019A94C /* JSON.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 5315EEAB0D941786001E3B2E /* JSON.framework */; };
545E8DD90F17D31A00E96BEA /* README in Resources */ = {isa = PBXBuildFile; fileRef = 545E8DD80F17D31A00E96BEA /* README */; };
+ 54F38C920F18017600EE4B8A /* Database.m in Sources */ = {isa = PBXBuildFile; fileRef = 53905A500D9430CD003D62CE /* Database.m */; };
+ 54F38CD00F18062E00EE4B8A /* Document.m in Sources */ = {isa = PBXBuildFile; fileRef = 53905A130D9429CE003D62CE /* Document.m */; };
+ 54F38CD20F18063D00EE4B8A /* Server.m in Sources */ = {isa = PBXBuildFile; fileRef = 5315EE780D940818001E3B2E /* Server.m */; };
8DC2EF530486A6940098B216 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C1666FE841158C02AAC07 /* InfoPlist.strings */; };
/* End PBXBuildFile section */
@@ -95,14 +95,11 @@
5315EE5C0D940717001E3B2E /* SBCouchServer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SBCouchServer.m; sourceTree = "<group>"; };
5315EE640D94078D001E3B2E /* Tests.octest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = Tests.octest; sourceTree = BUILT_PRODUCTS_DIR; };
5315EE650D94078D001E3B2E /* Tests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Tests-Info.plist"; sourceTree = "<group>"; };
- 5315EE770D940818001E3B2E /* Server.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Server.h; sourceTree = "<group>"; };
5315EE780D940818001E3B2E /* Server.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Server.m; sourceTree = "<group>"; };
5315EEA00D941786001E3B2E /* JSON.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = JSON.xcodeproj; path = vendor/JSON/JSON.xcodeproj; sourceTree = "<group>"; };
53905A0E0D9429B4003D62CE /* NSDictionary+CouchObjC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSDictionary+CouchObjC.h"; sourceTree = "<group>"; };
53905A0F0D9429B4003D62CE /* NSDictionary+CouchObjC.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSDictionary+CouchObjC.m"; sourceTree = "<group>"; };
- 53905A120D9429CE003D62CE /* Document.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Document.h; sourceTree = "<group>"; };
53905A130D9429CE003D62CE /* Document.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Document.m; sourceTree = "<group>"; };
- 53905A4F0D9430CD003D62CE /* Database.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Database.h; sourceTree = "<group>"; };
53905A500D9430CD003D62CE /* Database.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Database.m; sourceTree = "<group>"; };
53905A560D943BD5003D62CE /* SBCouchDatabase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SBCouchDatabase.h; sourceTree = "<group>"; };
53905A570D943BD5003D62CE /* SBCouchDatabase.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SBCouchDatabase.m; sourceTree = "<group>"; };
@@ -224,11 +221,8 @@
5315EE760D9407F0001E3B2E /* Tests */ = {
isa = PBXGroup;
children = (
- 5315EE770D940818001E3B2E /* Server.h */,
5315EE780D940818001E3B2E /* Server.m */,
- 53905A4F0D9430CD003D62CE /* Database.h */,
53905A500D9430CD003D62CE /* Database.m */,
- 53905A120D9429CE003D62CE /* Document.h */,
53905A130D9429CE003D62CE /* Document.m */,
);
path = Tests;
@@ -399,9 +393,9 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
- 5315EE790D940818001E3B2E /* Server.m in Sources */,
- 53905A140D9429CE003D62CE /* Document.m in Sources */,
- 53905A510D9430CD003D62CE /* Database.m in Sources */,
+ 54F38CD20F18063D00EE4B8A /* Server.m in Sources */,
+ 54F38C920F18017600EE4B8A /* Database.m in Sources */,
+ 54F38CD00F18062E00EE4B8A /* Document.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Oops, something went wrong.

0 comments on commit 08e1c5b

Please sign in to comment.