mirror of
https://github.com/zhigang1992/RestKit.git
synced 2026-04-21 19:42:59 +08:00
Ensure serializationMIMEType is configured when initializing object loaders via loaderWithURL: or loaderWithResourcePath: fixes #567
This commit is contained in:
@@ -361,6 +361,7 @@ static dispatch_queue_t defaultMappingQueue = nil;
|
||||
}
|
||||
|
||||
- (void)configureObjectLoader:(RKObjectLoader *)objectLoader {
|
||||
objectLoader.serializationMIMEType = self.serializationMIMEType;
|
||||
[self configureRequest:objectLoader];
|
||||
}
|
||||
|
||||
|
||||
@@ -345,4 +345,12 @@
|
||||
assertThat(objectLoader.params, is(equalTo(myParams)));
|
||||
}
|
||||
|
||||
- (void)testInitializationOfObjectLoaderViaManagerConfiguresSerializationMIMEType {
|
||||
RKObjectManager *objectManager = RKTestNewObjectManager();
|
||||
objectManager.serializationMIMEType = RKMIMETypeJSON;
|
||||
RKObjectLoader *loader = [objectManager loaderWithResourcePath:@"/test"];
|
||||
assertThat(loader.serializationMIMEType, isNot(nilValue()));
|
||||
assertThat(loader.serializationMIMEType, is(equalTo(RKMIMETypeJSON)));
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user