Details
-
Bug
-
Resolution: Done
-
Major
-
1.3.0
-
None
-
None
Description
The following test is failing, saving the object twice because after the first insert the id is not part of serialized value.
it(@"should retrieve only one element when we save an object without id, read all and update it", ^{ NSMutableDictionary* user1 = [NSMutableDictionary dictionaryWithObjectsAndKeys:@"Christos", @"name", nil]; BOOL success; success = [sqliteStorage save:user1 error:nil]; [[theValue(success) should] equal:theValue(YES)]; // reload store //sqliteStorage = [AGSQLiteStorage storeWithConfig:config]; // read all NSArray *object = [sqliteStorage readAll]; [[[object[0] objectForKey:@"name"] should] equal:@"Christos"]; success = [sqliteStorage save:object[0] error:nil]; // read all the store and count NSArray* objects = [sqliteStorage readAll]; [[objects should] haveCountOf:(NSUInteger)1]; });