Context("when the domain is owned", func() { BeforeEach(func() { requirementsFactory.LoginSuccess = true requirementsFactory.TargetedOrgSuccess = true domainRepo.FindByNameInOrgReturns( models.DomainFields{ Name: "foo1.com", Guid: "foo1-guid", Shared: false, }, nil) }) It("informs the user that the domain is not shared", func() { runCommand("foo1.com") Expect(domainRepo.DeleteSharedDomainCallCount()).To(BeZero()) Expect(ui.Outputs).To(ContainSubstrings( []string{"FAILED"}, []string{"domain"}, []string{"foo1.com"}, []string{"is an owned domain, not a shared domain."}, []string{"TIP"}, []string{"Use `cf delete-domain` to delete owned domains."}, )) }) }) Context("when logged in and targeted an organiztion", func() { BeforeEach(func() { requirementsFactory.LoginSuccess = true requirementsFactory.TargetedOrgSuccess = true domainRepo.FindByNameInOrgReturns(