Example #1
0
		callPush("app")

		testassert.SliceContains(ui.Outputs, testassert.Lines{
			{"Uploading"},
			{"FAILED"},
		})
	})

	Describe("when binding the route fails", func() {
		BeforeEach(func() {
			routeRepo.FindByHostAndDomainRoute.Host = "existing-app"
			routeRepo.FindByHostAndDomainRoute.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")

			testassert.SliceContains(ui.Outputs, testassert.Lines{
				{"FAILED"},
				{"existing-app.foo.cf-app.com", "already in use"},
				{"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")