예제 #1
0
			err      error
		)

		BeforeEach(func() {
			taskDef = model_helpers.NewValidTaskDefinition()
		})

		JustBeforeEach(func() {
			err = controller.DesireTask(logger, taskDef, taskGuid, domain)
		})

		Context("when the desire is successful", func() {
			It("desires the task with the requested definitions", func() {
				Expect(err).NotTo(HaveOccurred())

				Expect(fakeTaskDB.DesireTaskCallCount()).To(Equal(1))
				_, actualTaskDef, actualTaskGuid, actualDomain := fakeTaskDB.DesireTaskArgsForCall(0)
				Expect(actualTaskDef).To(Equal(taskDef))
				Expect(actualTaskGuid).To(Equal(taskGuid))
				Expect(actualDomain).To(Equal(domain))
			})

			It("requests an auction", func() {
				Expect(fakeAuctioneerClient.RequestTaskAuctionsCallCount()).To(Equal(1))

				var volumeMounts []string
				for _, volMount := range taskDef.VolumeMounts {
					volumeMounts = append(volumeMounts, volMount.Driver)
				}

				expectedStartRequest := auctioneer.TaskStartRequest{