Skip to content

Commit

Permalink
Cf space-users now lists space supporters
Browse files Browse the repository at this point in the history
fixes #2219
[finishes #179982523]

Authored-by: Merric de Launey <mdelauney@pivotal.io>
  • Loading branch information
MerricdeLauney committed Oct 26, 2021
1 parent 9159087 commit f35afe0
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions command/v7/space_users_command.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ func (cmd *SpaceUsersCommand) Execute(args []string) error {
func (cmd SpaceUsersCommand) displaySpaceUsers(orgUsersByRoleType map[constant.RoleType][]resources.User) {
cmd.displayRoleGroup(orgUsersByRoleType[constant.SpaceManagerRole], "SPACE MANAGER")
cmd.displayRoleGroup(orgUsersByRoleType[constant.SpaceDeveloperRole], "SPACE DEVELOPER")
cmd.displayRoleGroup(orgUsersByRoleType[constant.SpaceSupporterRole], "SPACE SUPPORTER")
cmd.displayRoleGroup(orgUsersByRoleType[constant.SpaceAuditorRole], "SPACE AUDITOR")
}

Expand Down
9 changes: 9 additions & 0 deletions command/v7/space_users_command_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,11 @@ var _ = Describe("space-users Command", func() {
PresentationName: "billing-manager",
GUID: "spaceDeveloper-guid",
}
spaceSupporter := resources.User{
Origin: "uaa",
PresentationName: "fred",
GUID: "spaceSupporter-guid",
}
spaceAuditor := resources.User{
Origin: "uaa",
PresentationName: "org-auditor",
Expand All @@ -176,6 +181,7 @@ var _ = Describe("space-users Command", func() {
spaceUsersByRole := map[constant.RoleType][]resources.User{
constant.SpaceManagerRole: {uaaAdmin, ldapAdmin, abbyUser, client},
constant.SpaceDeveloperRole: {spaceDeveloper},
constant.SpaceSupporterRole: {spaceSupporter},
constant.SpaceAuditorRole: {spaceAuditor},
}

Expand All @@ -199,6 +205,9 @@ var _ = Describe("space-users Command", func() {
Expect(testUI.Out).To(Say(`\nSPACE DEVELOPER`))
Expect(testUI.Out).To(Say(`\n billing-manager \(uaa\)`))
Expect(testUI.Out).To(Say(`\n`))
Expect(testUI.Out).To(Say(`\nSPACE SUPPORTER`))
Expect(testUI.Out).To(Say(`\n fred \(uaa\)`))
Expect(testUI.Out).To(Say(`\n`))
Expect(testUI.Out).To(Say(`\nSPACE AUDITOR`))
Expect(testUI.Out).To(Say(`\n org-auditor \(uaa\)`))

Expand Down
4 changes: 4 additions & 0 deletions integration/v7/isolated/space_users_command_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,14 @@ var _ = Describe("space-users command", func() {
var (
spaceManagerUser string
spaceDeveloperUser string
spaceSupporterUser string
spaceAuditorUser1 string
)

BeforeEach(func() {
spaceManagerUser, _ = helpers.CreateUserInSpaceRole(orgName, spaceName, "SpaceManager")
spaceDeveloperUser, _ = helpers.CreateUserInSpaceRole(orgName, spaceName, "SpaceDeveloper")
spaceSupporterUser, _ = helpers.CreateUserInSpaceRole(orgName, spaceName, "SpaceSupporter")
spaceAuditorUser1, _ = helpers.CreateUserInSpaceRole(orgName, spaceName, "SpaceAuditor")
})

Expand All @@ -61,6 +63,8 @@ var _ = Describe("space-users command", func() {
Eventually(session).Should(Say(`\s+%s \(uaa\)`, spaceManagerUser))
Eventually(session).Should(Say("SPACE DEVELOPER"))
Eventually(session).Should(Say(`\s+%s \(uaa\)`, spaceDeveloperUser))
Eventually(session).Should(Say("SPACE SUPPORTER"))
Eventually(session).Should(Say(`\s+%s \(uaa\)`, spaceSupporterUser))
Eventually(session).Should(Say("SPACE AUDITOR"))
Eventually(session).Should(Say(`\s+%s \(uaa\)`, spaceAuditorUser1))
Eventually(session).Should(Exit(0))
Expand Down

0 comments on commit f35afe0

Please sign in to comment.