@@ -116,43 +116,21 @@ func TestWithoutOmitsEmptyAnnotationOnRelation(t *testing.T) {
116
116
}
117
117
relationships := jsonData ["data" ].(map [string ]interface {})["relationships" ].(map [string ]interface {})
118
118
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" ]
121
121
if ! ok {
122
122
t .Fatal ("Was expecting the data.relationships.posts key/value to have been present" )
123
123
}
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
- }
139
124
140
- // Verifiy the "current_post" was a null
125
+ // Verify the "current_post" was a null
141
126
currentPost , postExists := relationships ["current_post" ]
142
127
if ! postExists {
143
128
t .Fatal ("Was expecting the data.relationships.current_post key/value to have NOT been omitted" )
144
129
}
145
- currentPostMap , ok : = currentPost .(map [string ]interface {})
130
+ _ , ok = currentPost .(map [string ]interface {})
146
131
if ! ok {
147
132
t .Fatal ("data.relationships.current_post was not a map" )
148
133
}
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
- }
156
134
}
157
135
158
136
func TestWithOmitsEmptyAnnotationOnRelation (t * testing.T ) {
0 commit comments