Пример #1
0
			err := repo.DeleteService(serviceInstance)
			Expect(err).To(HaveOccurred())
			Expect(err).To(BeAssignableToTypeOf(&errors.ServiceAssociationError{}))
		})

		It("doesn't delete the service when keys are bound", func() {
			setupTestServer()

			serviceInstance := models.ServiceInstance{}
			serviceInstance.GUID = "my-service-instance-guid"
			serviceInstance.ServiceKeys = []models.ServiceKeyFields{
				{
					Name: "fake-service-key-1",
					URL:  "/v2/service_keys/service-key-1-guid",
					GUID: "service-key-1-guid",
				},
				{
					Name: "fake-service-key-2",
					URL:  "/v2/service_keys/service-key-2-guid",
					GUID: "service-key-2-guid",
				},
			}

			err := repo.DeleteService(serviceInstance)
			Expect(err).To(HaveOccurred())
			Expect(err).To(BeAssignableToTypeOf(&errors.ServiceAssociationError{}))
		})
	})

	Describe("RenameService", func() {
		Context("when the service is not user provided", func() {