MCPcopy Create free account
hub / github.com/couchbase/sync_gateway / TestCreateLegacyRevDoc

Function TestCreateLegacyRevDoc

rest/api_test.go:1004–1017  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1002}
1003
1004func TestCreateLegacyRevDoc(t *testing.T) {
1005 rt := NewRestTester(t, nil)
1006 defer rt.Close()
1007
1008 // create legacy rev (without CV)
1009 dbc, ctx := rt.GetSingleTestDatabaseCollectionWithUser()
1010 _, _ = dbc.CreateDocNoHLV(t, ctx, "legacydoc", db.Body{"foo": "bar"})
1011
1012 // fetch doc and assert that no _vv is present
1013 ds := dbc.GetCollectionDatastore()
1014 _, _, err := ds.GetXattrs(ctx, "legacydoc", []string{base.VvXattrName})
1015 require.Error(t, err) // should error as xattr not found
1016 base.RequireXattrNotFoundError(t, err)
1017}
1018
1019// TestBulkDocsNoEdits verifies that POSTing /_bulk_docs with new_edits=false stores
1020// the provided revisions verbatim, and subsequent posts append the given history without generating new rev IDs.

Callers

nothing calls this directly

Calls 8

CloseMethod · 0.95
NewRestTesterFunction · 0.85
CreateDocNoHLVMethod · 0.45
GetXattrsMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected