예제 #1
0
						Expect(actualTask.AssigneeID).To(Equal(uint(2)))
					})
				})
			})
		})

		Describe("dueDate updates", func() {
			Context("when original task had a due date", func() {
				BeforeEach(func() {
					originalTask.DueDate = "1970-01-01"
				})

				Context("and new task has empty due date", func() {
					BeforeEach(func() {
						task.DueDate = time.Time{}

						expectedTaskUpdateConfig.DueDate = ""
						expectedTaskUpdateConfig.Remove = []string{"due_date"}

						expectedTask.DueDate = ""
					})

					It("removes dueDate", func() {
						actualTask, err := client.UpdateTask(task)
						Expect(err).NotTo(HaveOccurred())

						Expect(actualTask.DueDate).To(Equal(time.Time{}))
					})
				})
예제 #2
0
			t, err = client.UpdateTask(taskAgain)
			return err
		}).Should(Succeed())
		taskAgain = t

		By("Verifying properties are reset")
		Expect(taskAgain.Starred).Should(BeFalse())
		Expect(taskAgain.Completed).Should(BeFalse())
		Expect(taskAgain.RecurrenceType).Should(Equal(""))
		Expect(taskAgain.RecurrenceCount).Should(Equal(uint(0)))
	})

	It("can update the due date", func() {
		By("Setting properties")
		firstDate := time.Date(1968, 1, 2, 0, 0, 0, 0, time.UTC)
		newTask.DueDate = firstDate

		By("Updating task")
		var t wl.Task
		Eventually(func() error {
			t, err = client.UpdateTask(newTask)
			return err
		}).Should(Succeed())
		newTask = t

		By("Ensuring due date is set")
		Expect(newTask.DueDate).Should(Equal(firstDate))

		By("Updating properties")
		newDate := time.Date(1972, 2, 3, 0, 0, 0, 0, time.UTC)
		newTask.DueDate = newDate