From 54e9313ad14269f57a13b32aac59aea17f86d151 Mon Sep 17 00:00:00 2001 From: Grant Ammons Date: Mon, 2 May 2016 06:34:38 -0400 Subject: Get completing todos to work correctly --- todolist/file_store_test.go | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'todolist/file_store_test.go') diff --git a/todolist/file_store_test.go b/todolist/file_store_test.go index d71c119..43b90d2 100644 --- a/todolist/file_store_test.go +++ b/todolist/file_store_test.go @@ -44,3 +44,12 @@ func TestDelete(t *testing.T) { store.Delete(1) assert.Equal(1, len(store.Data)) } + +func TestComplete(t *testing.T) { + assert := assert.New(t) + store := &FileStore{FileLocation: "todos.json"} + store.Load() + assert.Equal(false, store.FindById(1).Completed) + store.Complete(1) + assert.Equal(true, store.FindById(1).Completed) +} -- cgit v1.3