update _rev for deleted test model
This commit is contained in:
parent
2b312d4c1f
commit
4ed4866bca
|
@ -70,6 +70,7 @@ exports.destroy = async function(ctx) {
|
||||||
const modelToDelete = await db.get(ctx.params.modelId)
|
const modelToDelete = await db.get(ctx.params.modelId)
|
||||||
|
|
||||||
await db.remove(modelToDelete)
|
await db.remove(modelToDelete)
|
||||||
|
|
||||||
const modelViewId = `all_${ctx.params.modelId}`
|
const modelViewId = `all_${ctx.params.modelId}`
|
||||||
|
|
||||||
// Delete all records for that model
|
// Delete all records for that model
|
||||||
|
|
|
@ -108,7 +108,11 @@ describe("/models", () => {
|
||||||
testModel = await createModel(request, instance._id, testModel)
|
testModel = await createModel(request, instance._id, testModel)
|
||||||
});
|
});
|
||||||
|
|
||||||
it("returns a success response when a model is deleted.", done => {
|
afterEach(() => {
|
||||||
|
delete testModel._rev
|
||||||
|
})
|
||||||
|
|
||||||
|
it("returns a success response when a model is deleted.", async done => {
|
||||||
request
|
request
|
||||||
.delete(`/api/${instance._id}/models/${testModel._id}/${testModel._rev}`)
|
.delete(`/api/${instance._id}/models/${testModel._id}/${testModel._rev}`)
|
||||||
.set(defaultHeaders)
|
.set(defaultHeaders)
|
||||||
|
|
Loading…
Reference in New Issue