예제 #1
0
		})

		It("fails if an organiztion is not targeted", func() {
			requirementsFactory.LoginSuccess = true
			RunCommand("foo.com")
			Expect(testcmd.CommandDidPassRequirements).To(BeFalse())
		})
	})

	Context("when logged in and targeted an organiztion", func() {
		BeforeEach(func() {
			requirementsFactory.LoginSuccess = true
			requirementsFactory.TargetedOrgSuccess = true
			domainRepo.FindByNameInOrgDomain = models.DomainFields{
				Name:   "foo.com",
				Guid:   "foo-guid",
				Shared: true,
			}
		})

		Describe("and the command is invoked interactively", func() {
			BeforeEach(func() {
				ui.Inputs = []string{"y"}
			})

			It("when the domain is not found it tells the user", func() {
				domainRepo.FindByNameInOrgApiResponse = errors.NewModelNotFoundError("Domain", "foo.com")
				RunCommand("foo.com")

				Expect(ui.Outputs).To(ContainSubstrings(
					[]string{"Deleting domain", "foo.com"},
예제 #2
0
파일: push_test.go 프로젝트: GABONIA/cli
				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.FindByNameStack = models.Stack{
					Name: "customLinux",
					Guid: "custom-linux-guid",
				}

				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",