Пример #1
0
			It("skips confirmation", func() {
				runCommand("-f", "foo.com")

				Expect(domainRepo.DeleteDomainGuid).To(Equal("foo-guid"))
				Expect(ui.Prompts).To(BeEmpty())
				testassert.SliceContains(ui.Outputs, testassert.Lines{
					{"Deleting domain", "foo.com"},
					{"OK"},
				})
			})
		})
	})

	Context("when a domain with the given name doesn't exist", func() {
		BeforeEach(func() {
			domainRepo.FindByNameInOrgApiResponse = errors.NewModelNotFoundError("Domain", "foo.com")
		})

		It("fails", func() {
			runCommand("foo.com")

			Expect(domainRepo.DeleteDomainGuid).To(Equal(""))

			testassert.SliceContains(ui.Outputs, testassert.Lines{
				{"OK"},
				{"foo.com", "not found"},
			})
		})
	})

	Context("when there is an error finding the domain", func() {