Skip to content

Commit

Permalink
updated test case
Browse files Browse the repository at this point in the history
  • Loading branch information
ibireme committed Dec 12, 2015
1 parent f46e95c commit a437526
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 2 additions & 4 deletions YYModel/NSObject+YYModel.m
Original file line number Diff line number Diff line change
Expand Up @@ -1198,10 +1198,8 @@ static id ModelToJSONObjectRecursive(NSObject *model) {
subDic = superDic[key];
if (subDic) {
if ([subDic isKindOfClass:[NSDictionary class]]) {
if (![subDic isKindOfClass:[NSMutableDictionary class]]) {
subDic = subDic.mutableCopy;
superDic[key] = subDic;
}
subDic = subDic.mutableCopy;
superDic[key] = subDic;
} else {
break;
}
Expand Down
3 changes: 3 additions & 0 deletions YYModelTests/YYTestModelToJSON.m
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,9 @@ - (void)testKeyPath {
XCTAssert([ext[@"b"] isEqualToString:@"b"]);
XCTAssert([ext[@"a"] isEqualToString:@"a"] || [ext[@"a"] isEqualToString:@"c"]);

model.f = @{@"g" : @""};
dic = [model yy_modelToJSONObject];

}

- (void)testDate {
Expand Down

0 comments on commit a437526

Please sign in to comment.