}) }) Context("the user provides a plan and org", func() { It("prints an error if updating the plan fails", func() { actor.UpdatePlanAndOrgForServiceReturns(errors.New("could not find org")) Expect(runCommand([]string{"-p", servicePlanName, "-o", "not-findable-org", serviceName})).To(BeFalse()) Expect(ui.Outputs()).To(ContainSubstrings( []string{"could not find org"}, )) }) It("disables the service plan for the org", func() { Expect(runCommand([]string{"-p", publicServicePlanName, "-o", orgName, serviceName})).To(BeTrue()) Expect(ui.Outputs()).To(ContainSubstrings( []string{"OK"}, )) Expect(actor.UpdatePlanAndOrgForServiceCallCount()).To(Equal(1)) service, plan, org, disable := actor.UpdatePlanAndOrgForServiceArgsForCall(0) Expect(service).To(Equal(serviceName)) Expect(plan).To(Equal(publicServicePlanName)) Expect(org).To(Equal(orgName)) Expect(disable).To(BeFalse()) }) }) }) }) })