func TestRestAPIKeyModify(t *testing.T) { t.Parallel() var req http.Request k := parse.RestAPIKey{ ApplicationID: defaultApplicationID, RestAPIKey: "42", } ensure.Nil(t, k.Modify(&req)) ensure.DeepEqual(t, req.Header.Get("X-Parse-Application-ID"), k.ApplicationID) ensure.DeepEqual(t, req.Header.Get("X-Parse-REST-API-Key"), k.RestAPIKey) }
func TestEmptyRestAPIKey(t *testing.T) { t.Parallel() mk := parse.RestAPIKey{ApplicationID: defaultApplicationID} ensure.Err(t, mk.Modify(nil), regexp.MustCompile("empty RestAPIKey")) }
func TestRestAPIKeyEmptyApplicationID(t *testing.T) { t.Parallel() var mk parse.RestAPIKey ensure.Err(t, mk.Modify(nil), regexp.MustCompile("empty ApplicationID")) }