Skip to content

Commit

Permalink
Add test for wrong rev
Browse files Browse the repository at this point in the history
  • Loading branch information
flimzy committed Mar 1, 2024
1 parent 95e6121 commit 045d117
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions x/sqlite/deleteattachment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,23 @@ func TestDBDeleteAttachment(t *testing.T) {
wantErr: "conflict",
wantStatus: http.StatusConflict,
})
tests.Add("doc exists, but wrong rev provided", test{
setup: func(t *testing.T, d driver.DB) {
_, err := d.Put(context.Background(), "foo", map[string]string{"foo": "bar"}, mock.NilOption)
if err != nil {
t.Fatal(err)
}
},
docID: "foo",
filename: "foo.txt",
options: kivik.Rev("1-wrong"),
wantErr: "document not found",
wantStatus: http.StatusNotFound,
})

/*
TODO:
- db missing => db not found
- doc does not exist at specified rev => missing rev
- doc does exist, no rev specified => conflict
- file does not exist => file not found
*/

Expand Down

0 comments on commit 045d117

Please sign in to comment.