Assert kanban tests exist in db

Signed-off-by: kolaente <k@knt.li>
This commit is contained in:
kolaente 2020-09-27 12:57:14 +02:00
parent 1776eb56fe
commit 0ca92144f2
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 8 additions and 0 deletions

View File

@ -78,6 +78,10 @@ func TestBucket_Delete(t *testing.T) {
err = x.Where("bucket_id = ?", 1).Find(&tasks)
assert.NoError(t, err)
assert.Len(t, tasks, 15)
db.AssertDBMissing(t, "buckets", map[string]interface{}{
"id": 2,
"list_id": 1,
})
})
t.Run("last bucket in list", func(t *testing.T) {
db.LoadAndAssertFixtures(t)
@ -88,5 +92,9 @@ func TestBucket_Delete(t *testing.T) {
err := b.Delete()
assert.Error(t, err)
assert.True(t, IsErrCannotRemoveLastBucket(err))
db.AssertDBExists(t, "buckets", map[string]interface{}{
"id": 34,
"list_id": 18,
}, false)
})
}