Beispiel #1
0
			It("gets the login prompts", func() {
				Expect(prompts).To(Equal(map[string]configuration.AuthPrompt{
					"username": configuration.AuthPrompt{
						DisplayName: "Email",
						Type:        configuration.AuthPromptTypeText,
					},
					"pin": configuration.AuthPrompt{
						DisplayName: "PIN Number",
						Type:        configuration.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())
			})
		})