config = rainmaker.Config{ Host: fakeCloudController.URL(), } service = rainmaker.NewSpacesService(config) spaceName = "my-space" org1, err = rainmaker.NewOrganizationsService(config).Create("org-123", token) Expect(err).NotTo(HaveOccurred()) org2, err = rainmaker.NewOrganizationsService(config).Create("org-456", token) Expect(err).NotTo(HaveOccurred()) }) Describe("Create/Get", func() { It("creates a space and allows it to be fetched from the cloud controller", func() { space, err := service.Create(spaceName, org1.GUID, token) Expect(err).NotTo(HaveOccurred()) Expect(space.Name).To(Equal(spaceName)) Expect(space.OrganizationGUID).To(Equal(org1.GUID)) fetchedSpace, err := service.Get(space.GUID, token) Expect(err).NotTo(HaveOccurred()) Expect(fetchedSpace.GUID).To(Equal(space.GUID)) }) Context("when the request errors", func() { BeforeEach(func() { config.Host = "" service = rainmaker.NewSpacesService(config) })