Skip to content
This repository has been archived by the owner on May 19, 2020. It is now read-only.

Commit

Permalink
Merge pull request #1142 from 18F/js-fix-invite-new-user
Browse files Browse the repository at this point in the history
Js fix invite flow for new user
  • Loading branch information
rememberlenny authored Jun 28, 2017
2 parents a783dd5 + 0ef464b commit ed4c63f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 20 deletions.
2 changes: 2 additions & 0 deletions controllers/uaa.go
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,8 @@ func (c *UAAContext) InviteUserToOrg(rw web.ResponseWriter, req *web.Request) {
err.writeTo(rw)
return
}
// Set the user info that get from the newly invited user.
getUserResp.ID = userInvite.UserID
}

rw.WriteHeader(http.StatusOK)
Expand Down
22 changes: 2 additions & 20 deletions controllers/uaa_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,6 @@ var inviteUsersTest = []BasicProxyTest{
ResponseCode: http.StatusOK,
Response: "{\"resources\": [{\"active\": true, \"verified\": false, \"id\": \"user-guid\", \"externalId\": \"[email protected]\" }]}",
},
{
RequestMethod: "GET",
ExpectedPath: "/Users/user-guid",
ResponseCode: http.StatusOK,
Response: "{\"active\": true, \"verified\": false, \"id\": \"user-guid\", \"externalId\": \"[email protected]\" }",
},
{
RequestMethod: "POST",
ExpectedPath: "/v2/users",
Expand Down Expand Up @@ -128,12 +122,6 @@ var inviteUsersTest = []BasicProxyTest{
ResponseCode: http.StatusOK,
Response: "{\"resources\": [{\"active\": true, \"verified\": false, \"id\": \"user-guid\", \"externalId\": \"[email protected]\" }]}",
},
{
RequestMethod: "GET",
ExpectedPath: "/Users/user-guid",
ResponseCode: http.StatusOK,
Response: "{\"active\": true, \"verified\": false, \"id\": \"user-guid\", \"externalId\": \"[email protected]\" }",
},
{
RequestMethod: "POST",
ExpectedPath: "/v2/users",
Expand All @@ -144,7 +132,7 @@ var inviteUsersTest = []BasicProxyTest{
{
BasicSecureTest: BasicSecureTest{
BasicConsoleUnitTest: BasicConsoleUnitTest{
TestName: "UAA Invite User with e-mail in body",
TestName: "UAA Invite User with e-mail in body (new user)",
SessionData: ValidTokenData,
EnvVars: GetMockCompleteEnvVars(),
},
Expand All @@ -165,13 +153,7 @@ var inviteUsersTest = []BasicProxyTest{
RequestMethod: "GET",
ExpectedPath: "/Users?filter=email+eq+%22test%40example.com%22",
ResponseCode: http.StatusOK,
Response: "{\"resources\": [{\"active\": true, \"verified\": false, \"id\": \"user-guid\", \"externalId\": \"[email protected]\" }]}",
},
{
RequestMethod: "GET",
ExpectedPath: "/Users/user-guid",
ResponseCode: http.StatusOK,
Response: "{\"active\": true, \"verified\": false, \"id\": \"user-guid\", \"externalId\": \"[email protected]\" }",
Response: "{\"resources\": []}",
},
{
RequestMethod: "POST",
Expand Down

0 comments on commit ed4c63f

Please sign in to comment.