createUser creates a user with the specified name.
(t *testing.T, restTester *RestTester, name string)
| 974 | |
| 975 | // createUser creates a user with the specified name. |
| 976 | func 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. |
| 986 | func deleteUser(t *testing.T, restTester *RestTester, name string) { |
no test coverage detected