update _rev for deleted test model

This commit is contained in:
Martin McKeaveney 2020-06-11 18:11:56 +01:00
parent 2b312d4c1f
commit 4ed4866bca
2 changed files with 6 additions and 1 deletions

View File

@ -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

View File

@ -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)