From 6c52e4936ff67dc63123f47a5cc67ef7d41ed5f4 Mon Sep 17 00:00:00 2001 From: Andrew Hankinson Date: Mon, 23 Jun 2014 16:14:21 -0400 Subject: [PATCH] Tests: Updating test for CPURLConnection This test checks to make sure the CPURLConnection withCredentials functionality works. --- Tests/Foundation/CPURLConnectionTest.j | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Tests/Foundation/CPURLConnectionTest.j b/Tests/Foundation/CPURLConnectionTest.j index 8c046a9c2..91df094d3 100644 --- a/Tests/Foundation/CPURLConnectionTest.j +++ b/Tests/Foundation/CPURLConnectionTest.j @@ -20,7 +20,7 @@ - (void)testSynchronousRequestSuccess { - var req = [CPURLRequest requestWithURL:@"Tests/Foundation/CPURLConnectionTest.j"], + var req = [CPURLRequest requestWithURL:@"Tests/Foundation/CPURLConnectionTest.j"], data = [CPURLConnection sendSynchronousRequest:req returningResponse:nil]; [self assert:CPData equals:[data class]]; @@ -30,10 +30,16 @@ - (void)testSynchronousRequestNotFound { - var req = [CPURLRequest requestWithURL:@"NotFound"], + var req = [CPURLRequest requestWithURL:@"NotFound"], data = [CPURLConnection sendSynchronousRequest:req returningResponse:nil]; [self assertNull:data]; } -@end \ No newline at end of file +- (void)testRequestWithCredentials +{ + var connection = [CPURLConnection connectionWithRequest:[CPURLRequest requestWithURL:@"Tests/Foundation/CPURLConnectionTest.j"] delegate:self withCredentials:YES]; + [self assertTrue:[connection withCredentials]]; +} + +@end