Skip to content

Commit da06d68

Browse files
committed
Fix TestDocCRUDWithCV escaping
1 parent e5b7067 commit da06d68

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

rest/api_test.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import (
2121
"mime/multipart"
2222
"net/http"
2323
"net/http/httptest"
24+
"net/url"
2425
"os"
2526
"path/filepath"
2627
"sort"
@@ -3269,18 +3270,16 @@ func TestDocCRUDWithCV(t *testing.T) {
32693270
require.Equal(t, updateVersion, getDocVersion)
32703271

32713272
// fetch by CV (using the first create version to test cache retrieval)
3272-
resp := rt.SendAdminRequest(http.MethodGet, fmt.Sprintf("/{{.keyspace}}/%s?rev=%s", docID, createVersion.CV.String()), "")
3273+
resp := rt.SendAdminRequest(http.MethodGet, fmt.Sprintf("/{{.keyspace}}/%s?rev=%s", docID, url.QueryEscape(createVersion.CV.String())), "")
32733274
RequireStatus(t, resp, http.StatusOK)
3274-
resp.DumpBody()
32753275
assert.NotContains(t, resp.BodyString(), `"update":true`)
32763276
assert.Contains(t, resp.BodyString(), `"create":true`)
32773277
assert.Contains(t, resp.BodyString(), `"_cv":"`+createVersion.CV.String()+`"`)
32783278
assert.Contains(t, resp.BodyString(), `"_rev":"`+createVersion.RevTreeID+`"`)
32793279

32803280
// fetch by CV - updated version
3281-
resp = rt.SendAdminRequest(http.MethodGet, fmt.Sprintf("/{{.keyspace}}/%s?rev=%s", docID, updateVersion.CV.String()), "")
3281+
resp = rt.SendAdminRequest(http.MethodGet, fmt.Sprintf("/{{.keyspace}}/%s?rev=%s", docID, url.QueryEscape(updateVersion.CV.String())), "")
32823282
RequireStatus(t, resp, http.StatusOK)
3283-
resp.DumpBody()
32843283
assert.NotContains(t, resp.BodyString(), `"create":true`)
32853284
assert.Contains(t, resp.BodyString(), `"update":true`)
32863285
assert.Contains(t, resp.BodyString(), `"_cv":"`+updateVersion.CV.String()+`"`)

0 commit comments

Comments
 (0)