Expect(quotaRepo.UpdateArgsForCall(0).NonBasicServicesAllowed).To(BeTrue()) }) }) Context("when --disallow-non-basic-services is provided", func() { It("updates the quota to disallow paid service plans", func() { quotaRepo.FindByNameReturns(quotaPaidService, nil) runCommand("--disallow-paid-service-plans", "my-for-profit-quota") Expect(quotaRepo.UpdateArgsForCall(0).NonBasicServicesAllowed).To(BeFalse()) }) }) Context("when updating a quota returns an error", func() { It("alerts the user when creating the quota fails", func() { quotaRepo.UpdateReturns(errors.New("WHOOP THERE IT IS")) runCommand("my-quota") Expect(ui.Outputs).To(ContainSubstrings( []string{"Updating space quota", "my-quota", "my-user"}, []string{"FAILED"}, )) }) It("fails if the allow and disallow flag are both passed", func() { runCommand("--disallow-paid-service-plans", "--allow-paid-service-plans", "my-for-profit-quota") Expect(ui.Outputs).To(ContainSubstrings( []string{"FAILED"}, )) }) })