Exemplo n.º 1
0
				})
			})
		})
	})

	Describe("CancelTask", func() {
		var (
			taskGuid, cellID string
			err              error
		)

		BeforeEach(func() {
			taskGuid = "task-guid"
			cellID = "the-cell"
			task := model_helpers.NewValidTask("hi-bob")
			fakeTaskDB.CancelTaskReturns(task, cellID, nil)
		})

		JustBeforeEach(func() {
			err = controller.CancelTask(logger, taskGuid)
		})

		Context("when the cancel request is normal", func() {
			Context("when canceling the task in the db succeeds", func() {
				BeforeEach(func() {
					cellPresence := models.CellPresence{CellId: "cell-id"}
					fakeServiceClient.CellByIdReturns(&cellPresence, nil)
				})

				It("returns no error", func() {
					Expect(fakeTaskDB.CancelTaskCallCount()).To(Equal(1))