예제 #1
0
		It("returns the services for the space, populated with plans", func() {
			services, err := serviceBuilder.GetServicesForSpaceWithPlans("spaceGuid")
			Expect(err).NotTo(HaveOccurred())

			Expect(len(services)).To(Equal(2))
			Expect(services[0].Plans[0]).To(Equal(planWithoutOrgs))
			Expect(services[1].Plans[0]).To(Equal(planWithoutOrgs))
		})
	})

	Describe(".GetAllServices", func() {
		BeforeEach(func() {
			serviceRepo.GetAllServiceOfferingsReturns = struct {
				ServiceOfferings []models.ServiceOffering
				Error            error
			}{
				[]models.ServiceOffering{service1, service1},
				nil,
			}
		})

		It("returns the named service, populated with plans", func() {
			services, err := serviceBuilder.GetAllServices()
			Expect(err).NotTo(HaveOccurred())

			Expect(len(services)).To(Equal(2))
		})
	})

	Describe(".GetAllServicesWithPlans", func() {
		BeforeEach(func() {