Пример #1
0
			})
		})
	})

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

		BeforeEach(func() {
			taskGuid = "task-guid"
			failureReason = "just cuz ;)"

			task := model_helpers.NewValidTask("hi-bob")
			fakeTaskDB.FailTaskReturns(task, nil)

			requestBody = &models.FailTaskRequest{
				TaskGuid:      taskGuid,
				FailureReason: failureReason,
			}
		})

		JustBeforeEach(func() {
			request = newTestRequest(requestBody)
			handler.FailTask(responseRecorder, request)
		})

		Context("when failing the task succeeds", func() {
			It("returns no error", func() {
				_, actualTaskGuid, actualFailureReason := fakeTaskDB.FailTaskArgsForCall(0)