Assert task test exists
continuous-integration/drone/pr Build is failing Details

Signed-off-by: kolaente <k@knt.li>
This commit is contained in:
kolaente 2020-09-27 16:40:58 +02:00
parent 5330a96ce4
commit ed92a84cfb
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 17 additions and 0 deletions

View File

@ -49,6 +49,14 @@ func TestTask_Create(t *testing.T) {
assert.Equal(t, int64(18), task.Index)
// Assert moving it into the default bucket
assert.Equal(t, int64(1), task.BucketID)
db.AssertDBExists(t, "tasks", map[string]interface{}{
"id": task.ID,
"title": "Lorem",
"description": "Lorem Ipsum Dolor",
"list_id": 1,
"created_by_id": 1,
"bucket_id": 1,
}, false)
})
t.Run("empty title", func(t *testing.T) {
@ -110,6 +118,12 @@ func TestTask_Update(t *testing.T) {
}
err := task.Update()
assert.NoError(t, err)
db.AssertDBExists(t, "tasks", map[string]interface{}{
"id": 1,
"title": "test10000",
"description": "Lorem Ipsum Dolor",
"list_id": 1,
}, false)
})
t.Run("nonexistant task", func(t *testing.T) {
db.LoadAndAssertFixtures(t)
@ -159,6 +173,9 @@ func TestTask_Delete(t *testing.T) {
}
err := task.Delete()
assert.NoError(t, err)
db.AssertDBMissing(t, "tasks", map[string]interface{}{
"id": 1,
})
})
}