Example #1
0
		callPush("app")

		Expect(ui.Outputs).To(ContainSubstrings(
			[]string{"Uploading"},
			[]string{"FAILED"},
		))
	})

	Describe("when binding the route fails", func() {
		BeforeEach(func() {
			routeRepo.FindByHostAndDomainReturns.Route.Host = "existing-app"
			routeRepo.FindByHostAndDomainReturns.Route.Domain = models.DomainFields{Name: "foo.cf-app.com"}
		})

		It("suggests using 'random-route' if the default route is taken", func() {
			routeRepo.BindErr = errors.NewHttpError(400, errors.INVALID_RELATION, "The URL not available")

			callPush("existing-app")

			Expect(ui.Outputs).To(ContainSubstrings(
				[]string{"FAILED"},
				[]string{"existing-app.foo.cf-app.com", "already in use"},
				[]string{"TIP", "random-route"},
			))
		})

		It("does not suggest using 'random-route' for other failures", func() {
			routeRepo.BindErr = errors.NewHttpError(500, "some-code", "exception happened")

			callPush("existing-app")