(orgGUID string, findByName func(SpaceRepository, string) (models.Space, error))
| 442 | } |
| 443 | |
| 444 | func testSpacesDidNotFindByNameWithOrg(orgGUID string, findByName func(SpaceRepository, string) (models.Space, error)) { |
| 445 | request := apifakes.NewCloudControllerTestRequest(testnet.TestRequest{ |
| 446 | Method: "GET", |
| 447 | Path: fmt.Sprintf("/v2/organizations/%s/spaces?q=name%%3Aspace1", orgGUID), |
| 448 | Response: testnet.TestResponse{ |
| 449 | Status: http.StatusOK, |
| 450 | Body: ` { "resources": [ ] }`, |
| 451 | }, |
| 452 | }) |
| 453 | |
| 454 | ts, handler, repo := createSpacesRepo(request) |
| 455 | defer ts.Close() |
| 456 | |
| 457 | _, apiErr := findByName(repo, "Space1") |
| 458 | Expect(handler).To(HaveAllRequestsCalled()) |
| 459 | |
| 460 | Expect(apiErr.(*errors.ModelNotFoundError)).NotTo(BeNil()) |
| 461 | } |
| 462 | |
| 463 | func createSpacesRepo(reqs ...testnet.TestRequest) (ts *httptest.Server, handler *testnet.TestHandler, repo SpaceRepository) { |
| 464 | ts, handler = testnet.NewServer(reqs) |
no test coverage detected