func TestEmptySessionTokenInSessionToken(t *testing.T) { t.Parallel() st := parse.SessionToken{ ApplicationID: defaultApplicationID, RestAPIKey: "rk", } ensure.Err(t, st.Modify(nil), regexp.MustCompile("empty SessionToken")) }
func TestSessionTokenModify(t *testing.T) { t.Parallel() st := parse.SessionToken{ ApplicationID: defaultApplicationID, RestAPIKey: "42", SessionToken: "43", } var req http.Request ensure.Nil(t, st.Modify(&req)) ensure.DeepEqual(t, req.Header.Get("X-Parse-Application-ID"), st.ApplicationID) ensure.DeepEqual(t, req.Header.Get("X-Parse-REST-API-Key"), st.RestAPIKey) ensure.DeepEqual(t, req.Header.Get("X-Parse-Session-Token"), st.SessionToken) }
func TestEmptySessionToken(t *testing.T) { t.Parallel() var st parse.SessionToken ensure.Err(t, st.Modify(nil), regexp.MustCompile("empty ApplicationID")) }