Ejemplo n.º 1
0
			Expect(ui.Outputs).To(ContainSubstrings(
				[]string{"Getting users in org", "Org1", "Space1", "my-user"},
				[]string{"SPACE MANAGER"},
				[]string{"user1"},
				[]string{"user2"},
				[]string{"SPACE DEVELOPER"},
				[]string{"user4"},
				[]string{"SPACE AUDITOR"},
				[]string{"user3"},
			))
		})

		Context("when cc api verson is >= 2.21.0", func() {
			BeforeEach(func() {
				userRepo.ListUsersInSpaceForRole_CallCount = 0
				userRepo.ListUsersInSpaceForRoleWithNoUAA_CallCount = 0
			})

			It("calls ListUsersInSpaceForRoleWithNoUAA()", func() {
				configRepo.SetApiVersion("2.22.0")
				runCommand("my-org", "my-sapce")

				Expect(userRepo.ListUsersInSpaceForRoleWithNoUAA_CallCount).To(BeNumerically(">=", 1))
				Expect(userRepo.ListUsersInSpaceForRole_CallCount).To(Equal(0))
			})
		})

		Context("when cc api verson is < 2.21.0", func() {
			It("calls ListUsersInSpaceForRole()", func() {
				configRepo.SetApiVersion("2.20.0")
				runCommand("my-org", "my-space")