Adding a basic integration test
This commit is contained in:
parent
4d271bf834
commit
f811f14bd3
21
tests/integration_test.go
Normal file
21
tests/integration_test.go
Normal 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)
|
||||
}
|
Reference in a new issue