Created
July 10, 2017 23:32
-
-
Save CollectiveHealth-gists/2b3188c65781a9da789c7628767411cf to your computer and use it in GitHub Desktop.
Testing iOS at Collective Health: Our network stub code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func setupSearchResults() { | |
let testBlock: OHHTTPStubsTestBlock | |
testBlock = { $0.URL?.path == "/api/v1/getcare/*" } | |
let fixture = OHPathForFile("GetCareResponse.json", self.dynamicType)! | |
successResponseBlock = { _ in | |
return OHHTTPStubsResponse( | |
fileAtPath: fixture, | |
statusCode: 200, | |
headers: ["Content-Type":"application/json"] | |
) | |
} | |
OHHTTPStubs.stubRequestsPassingTest(testBlock, withStubResponse: responseBlock) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment