Пример #1
0
		Expect(routeRepo.CreatedHost).To(BeEmpty())
		Expect(routeRepo.CreatedDomainGuid).To(BeEmpty())
		Expect(routeRepo.FindByHostAndDomainHost).To(Equal("my-new-app"))
		Expect(routeRepo.BoundAppGuid).To(Equal("my-new-app-guid"))
		Expect(routeRepo.BoundRouteGuid).To(Equal("my-route-guid"))

		testassert.SliceContains(ui.Outputs, testassert.Lines{
			{"Using", "my-new-app.foo.cf-app.com"},
			{"Binding", "my-new-app.foo.cf-app.com"},
			{"OK"},
		})
	})

	It("creates an app from the flags provided on the command line", func() {
		domainRepo.FindByNameInOrgDomain = models.DomainFields{
			Name: "bar.cf-app.com",
			Guid: "bar-domain-guid",
		}
		routeRepo.FindByHostAndDomainErr = true
		stackRepo.FindByNameStack = models.Stack{
			Name: "customLinux",
			Guid: "custom-linux-guid",
		}
		appRepo.ReadNotFound = true

		callPush(
			"-c", "unicorn -c config/unicorn.rb -D",
			"-d", "bar.cf-app.com",
			"-n", "my-hostname",
			"-i", "3",
			"-m", "2G",
			"-b", "https://github.com/heroku/heroku-buildpack-play.git",
Пример #2
0
			Expect(testcmd.CommandDidPassRequirements).To(BeFalse())
		})

		It("fails when the an org is not targetted", func() {
			requirementsFactory.TargetedOrgSuccess = false
			runCommand("foo.com")

			Expect(testcmd.CommandDidPassRequirements).To(BeFalse())
		})
	})

	Context("when the domain exists", func() {
		BeforeEach(func() {
			domainRepo.FindByNameInOrgDomain = models.DomainFields{
				Name: "foo.com",
				Guid: "foo-guid",
			}
		})

		It("deletes domains", func() {
			runCommand("foo.com")

			Expect(domainRepo.DeleteDomainGuid).To(Equal("foo-guid"))

			testassert.SliceContains(ui.Prompts, testassert.Lines{
				{"really delete the domain foo.com"},
			})
			testassert.SliceContains(ui.Outputs, testassert.Lines{
				{"Deleting domain", "foo.com", "my-user"},
				{"OK"},
			})