Ejemplo n.º 1
0
			})
		})
	})

	Describe("FailTask", func() {
		var (
			taskGuid      string
			failureReason string
			err           error
		)

		BeforeEach(func() {
			taskGuid = "task-guid"
			failureReason = "just cuz ;)"
			task := model_helpers.NewValidTask("hi-bob")
			fakeTaskDB.FailTaskReturns(task, nil)
		})

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

		Context("when failing the task succeeds", func() {
			It("returns no error", func() {
				_, actualTaskGuid, actualFailureReason := fakeTaskDB.FailTaskArgsForCall(0)
				Expect(actualTaskGuid).To(Equal(taskGuid))
				Expect(actualFailureReason).To(Equal(failureReason))
				Expect(err).NotTo(HaveOccurred())
			})

			Context("and the task has a complete URL", func() {