本文整理汇总了Golang中github.com/cloudfoundry/cli/cf/api/fakes.FakeDomainRepository.FindByNameInOrgDomain方法的典型用法代码示例。如果您正苦于以下问题:Golang FakeDomainRepository.FindByNameInOrgDomain方法的具体用法?Golang FakeDomainRepository.FindByNameInOrgDomain怎么用?Golang FakeDomainRepository.FindByNameInOrgDomain使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/cloudfoundry/cli/cf/api/fakes.FakeDomainRepository
的用法示例。
在下文中一共展示了FakeDomainRepository.FindByNameInOrgDomain方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1:
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"},
))
})
示例2:
callPush("of-bel-air")
Expect(ui.Outputs).ToNot(ContainSubstrings(
[]string{"Error refreshing auth token"},
))
Expect(ui.Outputs).To(ContainSubstrings(
[]string{"FAILED"},
[]string{"accidentally the UAA"},
))
})
})
Context("when multiple domains are specified in manifest", func() {
BeforeEach(func() {
domainRepo.FindByNameInOrgDomain = []models.DomainFields{
models.DomainFields{Name: "example1.com", Guid: "example-domain-guid"},
models.DomainFields{Name: "example2.com", Guid: "example-domain-guid"},
}
manifestRepo.ReadManifestReturns.Manifest = multipleDomainsManifest()
})
It("creates a route for each domain", func() {
callPush()
Expect(ui.Outputs).To(ContainSubstrings(
[]string{"Creating", "manifest-host.example1.com"},
[]string{"OK"},
[]string{"Binding", "manifest-host.example1.com"},
[]string{"OK"},
[]string{"Creating", "manifest-host.example2.com"},
[]string{"OK"},
示例3:
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",
示例4:
It("fails if an organiztion is not targeted", func() {
requirementsFactory.LoginSuccess = true
Expect(runCommand("foo.com")).To(BeFalse())
})
})
Context("when logged in and targeted an organiztion", func() {
BeforeEach(func() {
requirementsFactory.LoginSuccess = true
requirementsFactory.TargetedOrgSuccess = true
domainRepo.FindByNameInOrgDomain = []models.DomainFields{
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(