Adding a basic integration test

This commit is contained in:
Marius Orcsik 2017-10-01 14:44:49 +02:00
parent 4d271bf834
commit f811f14bd3
No known key found for this signature in database
GPG key ID: C36D1EBE93A6EEAE

21
tests/integration_test.go Normal file
View file

@ -0,0 +1,21 @@
package tests
import (
"testing"
"activitypub"
"jsonld"
)
func Test_AcceptSerialization(t *testing.T) {
o := activitypub.AcceptNew("https://localhost/myactivity")
o.Name = make(activitypub.NaturalLanguageValue, 1)
o.Name["en"] = "test"
ctx := jsonld.Context{URL:"https://www.w3.org/ns/activitystreams"}
bytes, err := jsonld.Marshal(o, &ctx)
if err != nil {
t.Errorf("Error: %v", err)
}
t.Logf("%s", bytes)
}