Add test for moving a task to another list

This commit is contained in:
kolaente 2021-03-24 22:47:03 +01:00
parent 81d021e872
commit be3184d49f
No known key found for this signature in database
GPG key ID: F40E70337AB24C9B

View file

@ -282,6 +282,26 @@ func TestTask_Update(t *testing.T) {
"bucket_id": 3,
}, false)
})
t.Run("move task to another list", func(t *testing.T) {
db.LoadAndAssertFixtures(t)
s := db.NewSession()
defer s.Close()
task := &Task{
ID: 1,
ListID: 2,
}
err := task.Update(s, u)
assert.NoError(t, err)
err = s.Commit()
assert.NoError(t, err)
db.AssertExists(t, "tasks", map[string]interface{}{
"id": 1,
"list_id": 2,
"bucket_id": 4,
}, false)
})
}
func TestTask_Delete(t *testing.T) {