Example #1
0
		}

		plan3 = models.ServicePlanFields{
			Name:                "service-plan3",
			GUID:                "service-plan3-guid",
			ServiceOfferingGUID: "service-guid2",
		}

		planWithoutOrgs = models.ServicePlanFields{
			Name:                "service-plan-without-orgs",
			GUID:                "service-plan-without-orgs-guid",
			ServiceOfferingGUID: "service-guid1",
		}

		planBuilder.GetPlansVisibleToOrgReturns([]models.ServicePlanFields{plan1, plan2}, nil)
		planBuilder.GetPlansForServiceWithOrgsReturns([]models.ServicePlanFields{plan1, plan2}, nil)
		planBuilder.GetPlansForManyServicesWithOrgsReturns([]models.ServicePlanFields{plan1, plan2, plan3}, nil)
		planBuilder.GetPlansForServiceForOrgReturns([]models.ServicePlanFields{plan1, plan2}, nil)
	})

	Describe(".GetServicesForSpace", func() {
		BeforeEach(func() {
			serviceRepo.GetServiceOfferingsForSpaceReturns([]models.ServiceOffering{service1, service1}, nil)
		})

		It("returns the services for the space", func() {
			services, err := serviceBuilder.GetServicesForSpace("spaceGUID")
			Expect(err).NotTo(HaveOccurred())

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