Ejemplo n.º 1
0
		It("fails with usage when invoked with any args what so ever ", func() {
			requirementsFactory.LoginSuccess = true
			requirementsFactory.TargetedOrgSuccess = true

			runCommand("whoops")
			Expect(ui.FailedWithUsage).To(BeTrue())
		})
	})

	Context("when logged in and an org is targeted", func() {
		BeforeEach(func() {
			requirementsFactory.LoginSuccess = true
			requirementsFactory.TargetedOrgSuccess = true
			requirementsFactory.OrganizationFields = models.OrganizationFields{
				Name: "my-org",
				Guid: "my-org-guid",
			}
		})

		Context("when there is at least one domain", func() {
			BeforeEach(func() {
				domainRepo.ListDomainsForOrgDomains = []models.DomainFields{
					models.DomainFields{
						Shared: false,
						Name:   "Private-domain1",
					},
					models.DomainFields{
						Shared: true,
						Name:   "The-shared-domain",
					},
					models.DomainFields{