当前位置: 首页>>代码示例>>Golang>>正文


Golang FakeDomainRepository.FindByNameInOrgDomain方法代码示例

本文整理汇总了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"},
			))
		})
开发者ID:BlueSpice,项目名称:cli,代码行数:30,代码来源:delete_domain_test.go

示例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"},
开发者ID:EndruBoy,项目名称:cli,代码行数:32,代码来源:push_test.go

示例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",
开发者ID:matanzit,项目名称:cli,代码行数:32,代码来源:push_test.go

示例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(
开发者ID:tools-alexuser01,项目名称:cli,代码行数:30,代码来源:delete_shared_domain_test.go


注:本文中的github.com/cloudfoundry/cli/cf/api/fakes.FakeDomainRepository.FindByNameInOrgDomain方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。