Beispiel #1
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"))

			Expect(ui.Prompts).To(ContainSubstrings([]string{"Really delete the domain foo.com"}))
			Expect(ui.Outputs).To(ContainSubstrings(
				[]string{"Deleting domain", "foo.com", "my-user"},
				[]string{"OK"},
			))
		})
Beispiel #2
0
				callPush("-t", "111", "Tim's 1st-Crazy__app!")
				Expect(*appRepo.CreatedAppParams().Name).To(Equal("Tim's 1st-Crazy__app!"))

				Expect(routeRepo.FindByHostAndDomainCalledWith.Host).To(Equal("tims-1st-crazy-app"))
				Expect(routeRepo.CreatedHost).To(Equal("tims-1st-crazy-app"))

				Expect(ui.Outputs).To(ContainSubstrings(
					[]string{"Creating", "tims-1st-crazy-app.foo.cf-app.com"},
					[]string{"Binding", "tims-1st-crazy-app.foo.cf-app.com"},
				))
				Expect(ui.Outputs).ToNot(ContainSubstrings([]string{"FAILED"}))
			})

			It("sets the app params from the flags", func() {
				domainRepo.FindByNameInOrgDomain = models.DomainFields{
					Name: "bar.cf-app.com",
					Guid: "bar-domain-guid",
				}
				stackRepo.FindByNameReturns(models.Stack{
					Name: "customLinux",
					Guid: "custom-linux-guid",
				}, nil)

				callPush(
					"-c", "unicorn -c config/unicorn.rb -D",
					"-d", "bar.cf-app.com",
					"-n", "my-hostname",
					"-k", "4G",
					"-i", "3",
					"-m", "2G",
					"-b", "https://github.com/heroku/heroku-buildpack-play.git",
					"-s", "customLinux",