It("does not change completed state", func() { actualTask, err := client.UpdateTask(task) Expect(err).NotTo(HaveOccurred()) Expect(actualTask.Completed).To(Equal(true)) }) }) }) Describe("starred updates", func() { Context("when starred state changes", func() { BeforeEach(func() { originalTask.Starred = false task.Starred = true expectedTaskUpdateConfig.Starred = true expectedTask.Starred = true }) It("changes starred state", func() { actualTask, err := client.UpdateTask(task) Expect(err).NotTo(HaveOccurred()) Expect(actualTask.Starred).To(Equal(true)) }) }) Context("when starred state is unchanged", func() { BeforeEach(func() { originalTask.Starred = true
return taskContains(completedTasksForList, newTask), err }).Should(BeTrue()) By("Verifying task appears in completed tasks") var completedTasks []wl.Task Eventually(func() bool { // It is statistically probable that one of the lists will // be deleted, so we ignore error here. completedTasks, _ = client.CompletedTasks(showCompletedTasks) return taskContains(completedTasks, newTask) }).Should(BeTrue()) }) It("can update tasks", func() { By("Setting properties") newTask.Starred = true newTask.Completed = true newTask.RecurrenceType = "week" newTask.RecurrenceCount = 2 By("Updating task") var t wl.Task Eventually(func() error { t, err = client.UpdateTask(newTask) return err }).Should(Succeed()) newTask = t By("Getting task again") var taskAgain wl.Task Eventually(func() error {