示例#1
0
				It("gets the login prompts", func() {
					Expect(prompts).To(Equal(map[string]coreconfig.AuthPrompt{
						"username": {
							DisplayName: "Email",
							Type:        coreconfig.AuthPromptTypeText,
						},
						"pin": {
							DisplayName: "PIN Number",
							Type:        coreconfig.AuthPromptTypePassword,
						},
					}))
				})

				It("saves the UAA server to the config", func() {
					Expect(config.UaaEndpoint()).To(Equal("https://uaa.run.pivotal.io"))
				})
			})

			Describe("when the login info API fails", func() {
				BeforeEach(func() {
					setupTestServer(loginServerLoginFailureRequest)
				})

				It("returns a failure response when the login info API fails", func() {
					Expect(handler).To(HaveAllRequestsCalled())
					Expect(apiErr).To(HaveOccurred())
					Expect(prompts).To(BeEmpty())
				})
			})