Exemplo n.º 1
0
			requirementsFactory.LoginSuccess = true
			requirementsFactory.TargetedOrgSuccess = true
		})

		It("unassigns a quota from a space", func() {
			space := models.Space{
				SpaceFields: models.SpaceFields{
					Name: "my-space",
					Guid: "my-space-guid",
				},
			}

			quota := models.SpaceQuota{Name: "my-quota", Guid: "my-quota-guid"}

			quotaRepo.FindByNameReturns(quota, nil)
			spaceRepo.FindByNameName = space.Name
			spaceRepo.Spaces = []models.Space{space}

			runCommand("my-space", "my-quota")

			Expect(ui.Outputs).To(ContainSubstrings(
				[]string{"Unassigning space quota", "my-quota", "my-space", "my-user"},
				[]string{"OK"},
			))

			Expect(quotaRepo.FindByNameArgsForCall(0)).To(Equal("my-quota"))
			spaceGuid, quotaGuid := quotaRepo.UnassignQuotaFromSpaceArgsForCall(0)
			Expect(spaceGuid).To(Equal("my-space-guid"))
			Expect(quotaGuid).To(Equal("my-quota-guid"))
		})
	})