Exemple #1
0
			Context("when the space quota was previously assigned to a space", func() {
				BeforeEach(func() {
					spaceRepo.Spaces = []models.Space{
						models.Space{
							SpaceFields: models.SpaceFields{
								Name: "my-space",
								Guid: "my-space-guid",
							},
							SpaceQuotaGuid: "another-quota",
						},
					}
				})

				It("warns the user that the operation was not performed", func() {
					Expect(quotaRepo.UpdateCallCount()).To(Equal(0))
					Expect(ui.Outputs).To(ContainSubstrings(
						[]string{"Assigning space quota", "to space", "my-user"},
						[]string{"FAILED"},
						[]string{"This space already has an assigned space quota."},
					))
				})
			})
		})

		Context("when an error occurs fetching the space", func() {
			BeforeEach(func() {
				spaceRepo.FindByNameErr = true
			})

			It("prints an error", func() {