예제 #1
0
				PlacementTags: []string{"test3", "test4"},
			},
		}
		cellSet = models.NewCellSet()
		cellSet.Add(cells[0])
		cellSet.Add(cells[1])
	})

	Describe("Cells", func() {
		JustBeforeEach(func() {
			handler.Cells(logger, responseRecorder, newTestRequest(""))
		})

		Context("when reading cells succeeds", func() {
			BeforeEach(func() {
				fakeServiceClient.CellsReturns(cellSet, nil)
			})

			It("returns a list of cells", func() {
				Expect(responseRecorder.Code).To(Equal(http.StatusOK))

				response := &models.CellsResponse{}
				err := response.Unmarshal(responseRecorder.Body.Bytes())
				Expect(err).NotTo(HaveOccurred())

				Expect(response.Error).To(BeNil())
				Expect(response.Cells).To(ConsistOf(cells))
			})
		})

		Context("when the serviceClient returns no cells", func() {