1
0

Fix moving repeating tasks to the done bucket

This commit is contained in:
kolaente
2021-04-15 16:36:24 +02:00
parent 2547de59ae
commit 6e5a9868f5
2 changed files with 25 additions and 3 deletions

View File

@ -302,6 +302,28 @@ func TestTask_Update(t *testing.T) {
"bucket_id": 4,
}, false)
})
t.Run("repeating tasks should not be moved to the done bucket", func(t *testing.T) {
db.LoadAndAssertFixtures(t)
s := db.NewSession()
defer s.Close()
task := &Task{
ID: 28,
Done: true,
}
err := task.Update(s, u)
assert.NoError(t, err)
err = s.Commit()
assert.NoError(t, err)
assert.False(t, task.Done)
assert.Equal(t, int64(1), task.BucketID)
db.AssertExists(t, "tasks", map[string]interface{}{
"id": 28,
"done": false,
"bucket_id": 1,
}, false)
})
}
func TestTask_Delete(t *testing.T) {