forked from Mirrors/jsonapi
add assertion that there are two posts
This commit is contained in:
parent
68210ff3ec
commit
d45d528865
|
@ -4,6 +4,7 @@ import (
|
|||
"bytes"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"reflect"
|
||||
"testing"
|
||||
)
|
||||
|
||||
|
@ -110,6 +111,10 @@ func TestRelations(t *testing.T) {
|
|||
if relations["current_post"] == nil {
|
||||
t.Fatalf("Current post relationship was not materialized")
|
||||
}
|
||||
|
||||
if reflect.ValueOf(relations["posts"]).Len() != 2 {
|
||||
t.Fatalf("Did not materialize two posts")
|
||||
}
|
||||
}
|
||||
|
||||
func TestNoRelations(t *testing.T) {
|
||||
|
|
Loading…
Reference in New Issue