}), }} handler.Create(responseRecorder, newTestRequest(tasks), logger) }) It("responds with 202", func() { Expect(responseRecorder.Code).To(Equal(http.StatusAccepted)) }) It("responds with an empty JSON body", func() { Expect(responseRecorder.Body.String()).To(Equal("{}")) }) It("should submit the task to the auction runner", func() { Expect(runner.ScheduleTasksForAuctionsCallCount()).To(Equal(1)) submittedTasks := runner.ScheduleTasksForAuctionsArgsForCall(0) Expect(submittedTasks).To(Equal(tasks)) }) }) Context("when the request body is a not a valid task", func() { var tasks []*models.Task BeforeEach(func() { tasks = []*models.Task{{TaskGuid: "the-task-guid"}} handler.Create(responseRecorder, newTestRequest(tasks), logger) })