Fixing some errors.

pull/212/head
Todd Knight 6 years ago
parent e8325a9f59
commit 078376da07

@ -239,7 +239,7 @@ func TestRepository_UpdateGroup(t *testing.T) {
newScopeId: org.PublicId,
wantErr: true,
wantRowsUpdate: 0,
wantErrMsg: "update group: update: lookup error lookup after write: failed record not found for 1",
wantErrMsg: "update group: update: lookup after write: record not found for 1",
wantIsError: db.ErrRecordNotFound,
},
{

@ -240,7 +240,7 @@ func TestRepository_UpdateRole(t *testing.T) {
newScopeId: org.PublicId,
wantErr: true,
wantRowsUpdate: 0,
wantErrMsg: "update role: update: lookup error lookup after write: failed record not found for 1",
wantErrMsg: "update role: update: lookup after write: record not found for 1",
wantIsError: db.ErrRecordNotFound,
},
{

@ -169,7 +169,7 @@ func TestRepository_UpdateUser(t *testing.T) {
},
wantErr: true,
wantRowsUpdate: 0,
wantErrMsg: "update user: update: lookup error lookup after write: failed record not found for 1",
wantErrMsg: "update user: update: lookup after write: record not found for 1",
wantIsErr: db.ErrRecordNotFound,
},
{

@ -166,40 +166,3 @@ func TestGrpcGatewayRouting_CustomActions(t *testing.T) {
}
}
}
func TestHandleGrpcGateway(t *testing.T) {
c := NewTestController(t, &TestControllerOpts{
DisableAuthorizationFailures: true,
})
defer c.Shutdown()
cases := []struct {
name string
path string
code int
}{
{
"Non existent path",
"v1/this-is-made-ups",
http.StatusNotFound,
},
{
"Unimplemented path",
"v1/scopes/1/host-catalogs/3/host-sets/hs_4",
http.StatusMethodNotAllowed,
},
}
for _, tc := range cases {
t.Run(tc.name, func(t *testing.T) {
url := fmt.Sprintf("%s/%s", c.ApiAddrs()[0], tc.path)
resp, err := http.Get(url)
if err != nil {
t.Errorf("Got error: %v when non was expected.", err)
}
if got, want := resp.StatusCode, tc.code; got != want {
t.Errorf("GET on %q got code %d, wanted %d", tc.path, got, want)
}
})
}
}

Loading…
Cancel
Save