Added method for custom file type
This commit is contained in:
parent
d4fbdfa228
commit
9d979991a4
1 changed files with 9 additions and 0 deletions
|
|
@ -45,6 +45,15 @@
|
||||||
expect(operation.error).will.beNil();
|
expect(operation.error).will.beNil();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void)testThatJSONRequestOperationAcceptsCustomContentType{
|
||||||
|
[AFJSONRequestOperation addAcceptableContentTypes:[NSSet setWithObject:@"application/customjson"]];
|
||||||
|
NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"/response-headers?Content-Type=application/customjson" relativeToURL:self.baseURL]];
|
||||||
|
AFJSONRequestOperation *operation = [[AFJSONRequestOperation alloc] initWithRequest:request];
|
||||||
|
[operation start];
|
||||||
|
expect([operation isFinished]).will.beTruthy();
|
||||||
|
expect(operation.error).will.beNil();
|
||||||
|
}
|
||||||
|
|
||||||
- (void)testThatJSONRequestOperationDoesNotAcceptInvalidContentType{
|
- (void)testThatJSONRequestOperationDoesNotAcceptInvalidContentType{
|
||||||
NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"/response-headers?Content-Type=application/no-json" relativeToURL:self.baseURL]];
|
NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"/response-headers?Content-Type=application/no-json" relativeToURL:self.baseURL]];
|
||||||
AFJSONRequestOperation *operation = [[AFJSONRequestOperation alloc] initWithRequest:request];
|
AFJSONRequestOperation *operation = [[AFJSONRequestOperation alloc] initWithRequest:request];
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue