Skip to content

Commit 6ff297d

Browse files
committed
Check metadata properties of response in TestNoCollectionsPutDocWithKeyspace
1 parent 318ffe9 commit 6ff297d

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

rest/api_collections_test.go

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -197,12 +197,19 @@ func TestNoCollectionsPutDocWithKeyspace(t *testing.T) {
197197
response = rt.SendAdminRequest(http.MethodPut, "/db._default._default/doc1", docBody)
198198
RequireStatus(t, response, http.StatusCreated)
199199

200-
// retrieve doc in both ways (_default._default and no fully-qualified keyspace)
201-
body := rt.GetDocBodyFromKeyspace("db._default._default", "doc1")
202-
assert.Equal(t, "bar", body["foo"])
203-
204-
body = rt.GetDocBodyFromKeyspace("db", "doc1")
205-
assert.Equal(t, "bar", body["foo"])
200+
version, _ := rt.GetDoc("doc1")
201+
202+
// retrieve doc in both ways (explicit and implicit _default scope/collection)
203+
for _, keyspace := range []string{
204+
"db._default._default", // fully qualified
205+
"db", // implicit
206+
} {
207+
body := rt.GetDocBodyFromKeyspace(keyspace, "doc1")
208+
assert.Equal(t, "bar", body["foo"])
209+
assert.Equal(t, "doc1", body["_id"])
210+
assert.Equal(t, version.RevTreeID, body["_rev"])
211+
assert.Equal(t, version.CV.String(), body["_cv"])
212+
}
206213
}
207214

208215
func TestSingleCollectionDCP(t *testing.T) {

0 commit comments

Comments
 (0)