Template
1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo synced 2024-11-29 05:06:11 +01:00

assert, that federation-host is present.

This commit is contained in:
Michael Jerger 2024-05-10 17:29:49 +02:00
parent 8d330fdb5d
commit 3bf423c97f

View file

@ -12,6 +12,8 @@ import (
"time" "time"
"code.gitea.io/gitea/models/db" "code.gitea.io/gitea/models/db"
"code.gitea.io/gitea/models/forgefed"
"code.gitea.io/gitea/models/unittest"
"code.gitea.io/gitea/models/user" "code.gitea.io/gitea/models/user"
"code.gitea.io/gitea/modules/activitypub" "code.gitea.io/gitea/modules/activitypub"
forgefed_modules "code.gitea.io/gitea/modules/forgefed" forgefed_modules "code.gitea.io/gitea/modules/forgefed"
@ -136,8 +138,13 @@ func TestActivityPubRepositoryInboxValid(t *testing.T) {
federatedSrv.URL, srv.URL, repositoryID)) federatedSrv.URL, srv.URL, repositoryID))
t.Logf("activity: %s", activity) t.Logf("activity: %s", activity)
resp, err := c.Post(activity, repoInboxURL) resp, err := c.Post(activity, repoInboxURL)
assert.NoError(t, err) assert.NoError(t, err)
assert.Equal(t, http.StatusNoContent, resp.StatusCode) assert.Equal(t, http.StatusNoContent, resp.StatusCode)
federationHost := unittest.AssertExistsAndLoadBean(t, &forgefed.FederationHost{ID: 1})
assert.Equal(t, "127.0.0.1", federationHost.HostFqdn)
}) })
} }