File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -56,4 +56,22 @@ - (void)testThatImageRequestOperationDoesNotAcceptInvalidFormatTypes {
56
56
expect (operation.error ).willNot .beNil ();
57
57
}
58
58
59
+ - (void )testThatImageResponseIsNotNilWhenRequestSucceeds {
60
+ NSURLRequest *request = [NSURLRequest requestWithURL: [NSURL URLWithString: @" /response-headers?Content-Type=image/png" relativeToURL: self .baseURL]];
61
+ AFImageRequestOperation *operation = [[AFImageRequestOperation alloc ] initWithRequest: request];
62
+ [operation start ];
63
+
64
+ expect ([operation isFinished ]).will .beTruthy ();
65
+ expect (operation.responseImage ).willNot .beNil ();
66
+ }
67
+
68
+ - (void )testThatImageResponseIsNilWhenRequestFails {
69
+ NSURLRequest *request = [NSURLRequest requestWithURL: [NSURL URLWithString: @" /status/404" relativeToURL: self .baseURL]];
70
+ AFImageRequestOperation *operation = [[AFImageRequestOperation alloc ] initWithRequest: request];
71
+ [operation start ];
72
+
73
+ expect ([operation isFinished ]).will .beTruthy ();
74
+ expect (operation.responseImage ).will .beNil ();
75
+ }
76
+
59
77
@end
You can’t perform that action at this time.
0 commit comments