configRepo.SetOrganizationFields(models.OrganizationFields{ Guid: "fake-org-guid", Name: "fake-org-name", }) }) It("tells the user that it is checking for the route", func() { cmd.Execute(flagContext) Expect(ui.Outputs).To(ContainSubstrings( []string{"Checking for route"}, )) }) It("tries to find the domain", func() { cmd.Execute(flagContext) 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)