mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-12-30 20:00:37 +00:00
Fix CI errors by adding @context to Person() and making sure types match
This commit is contained in:
parent
46cab80ef4
commit
86a3221563
2 changed files with 5 additions and 3 deletions
|
@ -38,9 +38,9 @@ func TestActivityPubPerson(t *testing.T) {
|
||||||
err := person.UnmarshalJSON(resp.Body.Bytes())
|
err := person.UnmarshalJSON(resp.Body.Bytes())
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
|
|
||||||
assert.Equal(t, "Person", person.Type)
|
assert.Equal(t, ap.ActivityVocabularyType("Person"), person.Type)
|
||||||
assert.Equal(t, username, person.Name)
|
assert.Equal(t, username, person.Name.String())
|
||||||
keyID := person.ID.String()
|
keyID := person.GetID().String()
|
||||||
assert.Regexp(t, fmt.Sprintf("activitypub/user/%s$", username), keyID)
|
assert.Regexp(t, fmt.Sprintf("activitypub/user/%s$", username), keyID)
|
||||||
assert.Regexp(t, fmt.Sprintf("activitypub/user/%s/outbox$", username), person.Outbox.GetID().String())
|
assert.Regexp(t, fmt.Sprintf("activitypub/user/%s/outbox$", username), person.Outbox.GetID().String())
|
||||||
assert.Regexp(t, fmt.Sprintf("activitypub/user/%s/inbox$", username), person.Inbox.GetID().String())
|
assert.Regexp(t, fmt.Sprintf("activitypub/user/%s/inbox$", username), person.Inbox.GetID().String())
|
||||||
|
|
|
@ -75,6 +75,8 @@ func Person(ctx *context.APIContext) {
|
||||||
ctx.Error(http.StatusInternalServerError, "Unmarshall", err)
|
ctx.Error(http.StatusInternalServerError, "Unmarshall", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
jsonmap["@context"] = "https://www.w3.org/ns/activitystreams"
|
||||||
|
|
||||||
ctx.JSON(http.StatusOK, jsonmap)
|
ctx.JSON(http.StatusOK, jsonmap)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue