Exemplo n.º 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 models.Role) ([]models.UserFields, error) {
					userFields := map[models.Role][]models.UserFields{
						models.RoleOrgManager:     {user, user2},
						models.RoleBillingManager: {user4},
						models.RoleOrgAuditor:     {user3},
						models.RoleOrgUser:        {user3},
					}[roleName]
					return userFields, nil
				}

				requirementsFactory.NewLoginRequirementReturns(requirements.Passing{})
				organizationReq := new(requirementsfakes.FakeOrganizationRequirement)
				organizationReq.GetOrganizationReturns(org)
				requirementsFactory.NewOrganizationRequirementReturns(organizationReq)
				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, ui)