actualLRP.State = "" Expect(serialization.ActualLRPToResponse(actualLRP, false).State).To(Equal(receptor.ActualLRPStateInvalid)) }) Context("when there is placement error", func() { BeforeEach(func() { actualLRP.State = models.ActualLRPStateUnclaimed actualLRP.PlacementError = diego_errors.INSUFFICIENT_RESOURCES_MESSAGE }) It("includes the placement error", func() { actualResponse := serialization.ActualLRPToResponse(actualLRP, false) Expect(actualResponse.PlacementError).To(Equal(diego_errors.INSUFFICIENT_RESOURCES_MESSAGE)) }) }) Context("when there is a crash reason", func() { BeforeEach(func() { actualLRP.State = models.ActualLRPStateCrashed actualLRP.CrashReason = "crashed" }) It("includes the placement error", func() { actualResponse := serialization.ActualLRPToResponse(actualLRP, false) Expect(actualResponse.CrashReason).To(Equal("crashed")) }) }) }) })