Exemplo n.º 1
0
		BeforeEach(func() {
			req = newTestRequest("")
			req.Form = url.Values{
				":process_guid": []string{"process-guid-1"},
				":index":        []string{"2"},
			}
		})

		JustBeforeEach(func() {
			handler.GetByProcessGuidAndIndex(responseRecorder, req)
		})

		Context("when getting the LRP group from the BBS succeeds", func() {
			BeforeEach(func() {
				fakeLegacyBBS.ActualLRPGroupByProcessGuidAndIndexReturns(
					oldmodels.ActualLRPGroup{Instance: &oldActualLRP2},
					nil,
				)
			})

			It("calls the BBS to retrieve the actual LRPs", func() {
				Expect(fakeLegacyBBS.ActualLRPGroupByProcessGuidAndIndexCallCount()).To(Equal(1))
				_, processGuid, index := fakeLegacyBBS.ActualLRPGroupByProcessGuidAndIndexArgsForCall(0)
				Expect(processGuid).To(Equal("process-guid-1"))
				Expect(index).To(Equal(2))
			})

			It("responds with 200 Status OK", func() {
				Expect(responseRecorder.Code).To(Equal(http.StatusOK))
			})

			It("returns an actual lrp response", func() {