Пример #1
0
			cellId        string
			failed        bool
			failureReason string
			result        string
			err           error
		)

		BeforeEach(func() {
			taskGuid = "t-guid"
			cellId = "c-id"
			failed = true
			failureReason = "some-error"
			result = "yeah"

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

		JustBeforeEach(func() {
			err = controller.CompleteTask(logger, taskGuid, cellId, failed, failureReason, result)
		})

		Context("when completing the task succeeds", func() {
			It("returns no error", func() {
				Expect(fakeTaskDB.CompleteTaskCallCount()).To(Equal(1))
				_, actualTaskGuid, actualCellId, actualFailed, actualFailureReason, actualResult := fakeTaskDB.CompleteTaskArgsForCall(0)
				Expect(actualTaskGuid).To(Equal(taskGuid))
				Expect(actualCellId).To(Equal(cellId))
				Expect(actualFailed).To(Equal(failed))
				Expect(actualFailureReason).To(Equal(failureReason))
				Expect(actualResult).To(Equal(result))