예제 #1
0
파일: domains_test.go 프로젝트: hail100/cli
		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{