Exemple #1
0
		})

		JustBeforeEach(func() {
			err = cmd.Execute(flagContext)
		})

		It("tells the user that it is checking for the route", func() {
			Expect(err).NotTo(HaveOccurred())
			Expect(ui.Outputs()).To(ContainSubstrings(
				[]string{"Checking for route"},
			))
		})

		It("tries to find the domain", func() {
			Expect(err).NotTo(HaveOccurred())
			Expect(domainRepo.FindByNameInOrgCallCount()).To(Equal(1))

			domainName, orgGUID := domainRepo.FindByNameInOrgArgsForCall(0)
			Expect(domainName).To(Equal("domain-name"))
			Expect(orgGUID).To(Equal("fake-org-guid"))
		})

		Context("when it finds the domain successfully", func() {
			var actualDomain models.DomainFields

			BeforeEach(func() {
				actualDomain = models.DomainFields{
					GUID: "domain-guid",
					Name: "domain-name",
				}
				domainRepo.FindByNameInOrgReturns(actualDomain, nil)