}, nil) spaceRepo.FindByNameReturns( models.Space{ SpaceFields: models.SpaceFields{ Name: "my-space", GUID: "my-space-guid", }, SpaceQuotaGUID: "", }, nil) }) Context("when the space quota was not previously assigned to a space", func() { It("associates the provided space with the provided space quota", func() { Expect(executeErr).NotTo(HaveOccurred()) spaceGUID, quotaGUID := quotaRepo.AssociateSpaceWithQuotaArgsForCall(0) Expect(spaceGUID).To(Equal("my-space-guid")) Expect(quotaGUID).To(Equal("quota-guid")) Expect(ui.Outputs()).To(ContainSubstrings( []string{"Assigning space quota", "to space", "my-user"}, []string{"OK"}, )) }) }) Context("when the space quota was previously assigned to a space", func() { BeforeEach(func() { spaceRepo.FindByNameReturns( models.Space{ SpaceFields: models.SpaceFields{