MCPcopy Create free account
hub / github.com/couchbase/sync_gateway / createUser

Function createUser

rest/oidc_api_test.go:976–983  ·  view source on GitHub ↗

createUser creates a user with the specified name.

(t *testing.T, restTester *RestTester, name string)

Source from the content-addressed store, hash-verified

974
975// createUser creates a user with the specified name.
976func createUser(t *testing.T, restTester *RestTester, name string) {
977 body := fmt.Sprintf(`{"name":"%s", "password":"pass", "email":"%s@couchbase.com"}`, name, name)
978 userEndpoint := fmt.Sprintf("/db/_user/%s", url.QueryEscape(name))
979 response := restTester.SendAdminRequest(http.MethodPut, userEndpoint, body)
980 RequireStatus(t, response, http.StatusCreated)
981 response = restTester.SendAdminRequest(http.MethodGet, userEndpoint, "")
982 RequireStatus(t, response, http.StatusOK)
983}
984
985// deleteUser deletes the specified user.
986func deleteUser(t *testing.T, restTester *RestTester, name string) {

Calls 2

RequireStatusFunction · 0.85
SendAdminRequestMethod · 0.80

Tested by

no test coverage detected