@@ -116,43 +116,21 @@ func TestWithoutOmitsEmptyAnnotationOnRelation(t *testing.T) {
116116 }
117117 relationships := jsonData ["data" ].(map [string ]interface {})["relationships" ].(map [string ]interface {})
118118
119- // Verifiy the "posts" relation was an empty array
120- posts , ok := relationships ["posts" ]
119+ // Verify the "posts" relation was an empty array
120+ _ , ok := relationships ["posts" ]
121121 if ! ok {
122122 t .Fatal ("Was expecting the data.relationships.posts key/value to have been present" )
123123 }
124- postsMap , ok := posts .(map [string ]interface {})
125- if ! ok {
126- t .Fatal ("data.relationships.posts was not a map" )
127- }
128- postsData , ok := postsMap ["data" ]
129- if ! ok {
130- t .Fatal ("Was expecting the data.relationships.posts.data key/value to have been present" )
131- }
132- postsDataSlice , ok := postsData .([]interface {})
133- if ! ok {
134- t .Fatal ("data.relationships.posts.data was not a slice []" )
135- }
136- if len (postsDataSlice ) != 0 {
137- t .Fatal ("Was expecting the data.relationships.posts.data value to have been an empty array []" )
138- }
139124
140- // Verifiy the "current_post" was a null
125+ // Verify the "current_post" was a null
141126 currentPost , postExists := relationships ["current_post" ]
142127 if ! postExists {
143128 t .Fatal ("Was expecting the data.relationships.current_post key/value to have NOT been omitted" )
144129 }
145- currentPostMap , ok : = currentPost .(map [string ]interface {})
130+ _ , ok = currentPost .(map [string ]interface {})
146131 if ! ok {
147132 t .Fatal ("data.relationships.current_post was not a map" )
148133 }
149- currentPostData , ok := currentPostMap ["data" ]
150- if ! ok {
151- t .Fatal ("Was expecting the data.relationships.current_post.data key/value to have been present" )
152- }
153- if currentPostData != nil {
154- t .Fatal ("Was expecting the data.relationships.current_post.data value to have been nil/null" )
155- }
156134}
157135
158136func TestWithOmitsEmptyAnnotationOnRelation (t * testing.T ) {
0 commit comments