config.SetSpaceFields(models.SpaceFields{}) spaceRepo.FindByNameErr = true ui := callTarget([]string{"-s", "my-space"}, reqFactory, config, orgRepo, spaceRepo) testassert.SliceContains(ui.Outputs, testassert.Lines{ {"FAILED"}, {"Unable to access space", "my-space"}, }) Expect(config.SpaceFields().Guid).To(Equal("")) Expect(ui.ShowConfigurationCalled).To(BeFalse()) }) It("TestTargetSpaceWhenSpaceNotFound", func() { spaceRepo.FindByNameNotFound = true ui := callTarget([]string{"-s", "my-space"}, reqFactory, config, orgRepo, spaceRepo) testassert.SliceContains(ui.Outputs, testassert.Lines{ {"FAILED"}, {"my-space", "not found"}, }) }) It("TestTargetOrganizationAndSpace", func() { org := models.Organization{} org.Name = "my-organization" org.Guid = "my-organization-guid" orgRepo.Organizations = []models.Organization{org}