}).Should(BeTrue()) }) }) It("can complete tasks", func() { var completedTasksForList []wl.Task By("Ensuring task is not already in completed tasks") showCompletedTasks := true Eventually(func() (bool, error) { completedTasksForList, err = client.CompletedTasksForListID(newList.ID, showCompletedTasks) return taskContains(completedTasksForList, newTask), err }).Should(BeFalse()) By("Completing task") newTask.Completed = true var t wl.Task Eventually(func() error { t, err = client.UpdateTask(newTask) return err }).Should(Succeed()) newTask = t By("Verifying task appears in completed tasks for list") Eventually(func() (bool, error) { completedTasksForList, err = client.CompletedTasksForListID(newList.ID, showCompletedTasks) return taskContains(completedTasksForList, newTask), err }).Should(BeTrue()) By("Verifying task appears in completed tasks")
actualTask, err := client.UpdateTask(task) Expect(err).NotTo(HaveOccurred()) Expect(actualTask.RecurrenceCount).To(Equal(task.RecurrenceCount)) Expect(actualTask.RecurrenceType).To(Equal(task.RecurrenceType)) }) }) }) }) Describe("completed updates", func() { Context("when completed state changes", func() { BeforeEach(func() { originalTask.Completed = false task.Completed = true expectedTaskUpdateConfig.Completed = true expectedTask.Completed = true }) It("changes completed state", func() { actualTask, err := client.UpdateTask(task) Expect(err).NotTo(HaveOccurred()) Expect(actualTask.Completed).To(Equal(true)) }) }) Context("when completed state is unchanged", func() { BeforeEach(func() { originalTask.Completed = true