コード例 #1
0
ファイル: push_test.go プロジェクト: Doebe/workplace
					[]string{"Binding", "example.com"},
				))
				Expect(ui.Outputs).ToNot(ContainSubstrings([]string{"existing-app.example.com"}))

				Expect(routeRepo.FindByHostAndDomainCalledWith.Domain.Name).To(Equal("example.com"))
				Expect(routeRepo.FindByHostAndDomainCalledWith.Host).To(Equal(""))
				Expect(routeRepo.CreatedHost).To(Equal(""))
				Expect(routeRepo.CreatedDomainGuid).To(Equal("domain-guid"))
			})
		})
	})

	Describe("service instances", func() {
		BeforeEach(func() {
			serviceRepo.FindInstanceByNameStub = func(name string) (models.ServiceInstance, error) {
				return maker.NewServiceInstance(name), nil
			}

			appRepo.CreateStub = func(params models.AppParams) (models.Application, error) {
				a := models.Application{}
				a.Name = *params.Name

				return a, nil
			}

			manifestRepo.ReadManifestReturns.Manifest = manifestWithServicesAndEnv()
		})

		Context("when the service is not bound", func() {
			BeforeEach(func() {
				appRepo.ReadReturns(models.Application{}, errors.NewModelNotFoundError("App", "the-app"))