JSON API new spec with deref

This commit is contained in:
Bel LaPointe
2020-07-22 20:40:44 -06:00
parent 4d667e7b11
commit 710e20d6e0
8 changed files with 86 additions and 46 deletions

View File

@@ -34,7 +34,7 @@ func TestIntegration(t *testing.T) {
randomOne(),
randomOne(),
}
ones[0].Connections = []entity.Peer{entity.Peer{Name: ones[2].Name, Relationship: ":("}}
ones[0].Connections = []entity.One{entity.One{Name: ones[2].Name, Relationship: ":("}}
t.Run("graph.Insert(...)", func(t *testing.T) {
for _, one := range ones {
@@ -91,7 +91,7 @@ func TestIntegration(t *testing.T) {
})
t.Run("graph.Update(foo, ++...); graph.Update(foo, --if :()", func(t *testing.T) {
err := graph.Update(ctx, ones[0].Query(), operator.Set{entity.Connections, []entity.Peer{entity.Peer{Name: "hello", Relationship: ":("}}})
err := graph.Update(ctx, ones[0].Query(), operator.Set{entity.Connections, []entity.One{entity.One{Name: "hello", Relationship: ":("}}})
if err != nil {
t.Fatal(err)
}
@@ -139,6 +139,6 @@ func randomOne() entity.One {
Image: "/path/to.jpg",
Text: "tee hee xd",
Modified: time.Now().UnixNano(),
Connections: []entity.Peer{},
Connections: []entity.One{},
}
}