}, nil) spaceRepo.Spaces = []models.Space{ models.Space{ SpaceFields: models.SpaceFields{ Name: "my-space", Guid: "my-space-guid", }, SpaceQuotaGuid: "", }, } }) Context("when the space quota was not previously assigned to a space", func() { It("associates the provided space with the provided space quota", func() { 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.Spaces = []models.Space{ models.Space{ SpaceFields: models.SpaceFields{