예제 #1
0
			requestBody = &models.DesireTaskRequest{
				TaskGuid:       taskGuid,
				Domain:         domain,
				TaskDefinition: taskDef,
			}
		})

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

		Context("when the desire is successful", func() {
			It("desires the task with the requested definitions", func() {
				Expect(fakeTaskDB.DesireTaskCallCount()).To(Equal(1))
				_, actualTaskDef, actualTaskGuid, actualDomain := fakeTaskDB.DesireTaskArgsForCall(0)
				taskDef.Action = &models.Action{
					TimeoutAction: &models.TimeoutAction{
						Action: models.WrapAction(&models.UploadAction{
							From: "web_location",
							To:   "potato",
							User: "******",
						}),
						DeprecatedTimeoutNs: int64(time.Second),
						TimeoutMs:           1000,
					},
				}
				Expect(actualTaskDef).To(Equal(taskDef))
				Expect(actualTaskGuid).To(Equal(taskGuid))
				Expect(actualDomain).To(Equal(domain))