Exemplo n.º 1
0
			})

			It("creates an app", func() {
				callPush("-t", "111", "app-name")
				Expect(ui.Outputs).ToNot(ContainSubstrings([]string{"FAILED"}))

				params := appRepo.CreateArgsForCall(0)
				Expect(*params.Name).To(Equal("app-name"))
				Expect(*params.SpaceGuid).To(Equal("my-space-guid"))

				Expect(routeRepo.FindByHostAndDomainCallCount()).To(Equal(1))
				host, _ := routeRepo.FindByHostAndDomainArgsForCall(0)
				Expect(host).To(Equal("app-name"))

				Expect(routeRepo.CreateCallCount()).To(Equal(1))
				createdHost, createdDomainFields, createdPath := routeRepo.CreateArgsForCall(0)
				Expect(createdHost).To(Equal("app-name"))
				Expect(createdDomainFields.Guid).To(Equal("foo-domain-guid"))
				Expect(createdPath).To(BeEmpty())

				Expect(routeRepo.BindCallCount()).To(Equal(1))
				boundRouteGUID, boundAppGUID := routeRepo.BindArgsForCall(0)
				Expect(boundAppGUID).To(Equal("app-name-guid"))
				Expect(boundRouteGUID).To(Equal("app-name-route-guid"))

				appGuid, _, _ := actor.UploadAppArgsForCall(0)
				Expect(appGuid).To(Equal("app-name-guid"))

				Expect(ui.Outputs).To(ContainSubstrings(
					[]string{"Creating app", "app-name", "my-org", "my-space"},
					[]string{"OK"},