示例#1
0
				// billing manager
				user3 := models.UserFields{}
				user3.Username = "******"
				user3.Guid = "3333"

				// auditors
				user4 := models.UserFields{}
				user4.Username = "******"
				user4.Guid = "4444"

				userRepo.ListUsersInOrgForRoleWithNoUAAStub = func(_ string, roleName string) ([]models.UserFields, error) {
					userFields := map[string][]models.UserFields{
						models.ORG_MANAGER:     []models.UserFields{user, user2},
						models.BILLING_MANAGER: []models.UserFields{user4},
						models.ORG_AUDITOR:     []models.UserFields{user3},
						models.ORG_USER:        []models.UserFields{user3},
					}[roleName]
					return userFields, nil
				}

				requirementsFactory.LoginSuccess = true
				requirementsFactory.Organization = org
				pluginUserModel = []plugin_models.GetOrgUsers_Model{}
				deps.PluginModels.OrgUsers = &pluginUserModel
			})

			It("populates the plugin model with users with single roles", func() {
				testcmd.RunCliCommand("org-users", []string{"the-org"}, requirementsFactory, updateCommandDependency, true)
				Ω(pluginUserModel).To(HaveLen(4))