Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save CollectiveHealth-gists/2b3188c65781a9da789c7628767411cf to your computer and use it in GitHub Desktop.
Save CollectiveHealth-gists/2b3188c65781a9da789c7628767411cf to your computer and use it in GitHub Desktop.
Testing iOS at Collective Health: Our network stub code
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