Beispiel #1
0
			))
		})

		It("fails when the user does not have access to the specified organization", func() {
			orgs := []models.Organization{}
			orgRepo.Organizations = orgs
			orgRepo.FindByNameErr = true

			callTarget([]string{"-o", "my-organization"})
			Expect(ui.Outputs).To(ContainSubstrings([]string{"FAILED"}))
			expectOrgToBeCleared()
			expectSpaceToBeCleared()
		})

		It("fails when the organization is not found", func() {
			orgRepo.FindByNameNotFound = true

			callTarget([]string{"-o", "my-organization"})

			Expect(ui.Outputs).To(ContainSubstrings(
				[]string{"FAILED"},
				[]string{"my-organization", "not found"},
			))

			expectOrgToBeCleared()
			expectSpaceToBeCleared()
		})

		It("fails to target a space if no organization is targeted", func() {
			config.SetOrganizationFields(models.OrganizationFields{})