It("returns the total number of allocated nodes", func() {
				Expect(repo.InstanceCount()).To(Equal(0))
			})
		})

		Describe("#Unbind", func() {
			It("returns an error", func() {
				err := repo.Unbind("NON-EXISTANT-INSTANCE", "SOME-BINDING")
				Expect(err).To(MatchError(brokerapi.ErrInstanceDoesNotExist))
			})
		})
	})

	Context("When one node is allocated", func() {
		BeforeEach(func() {
			err := repo.Create("foo")
			Expect(err).ToNot(HaveOccurred())
		})

		Describe("#Bind", func() {
			BeforeEach(func() {
				fakeAgentClient.CredentialsFunc = func(rootURL string) (redis.Credentials, error) {
					if rootURL == "https://10.0.0.1:1234" {
						return redis.Credentials{
							Port:     123456,
							Password: "******",
						}, nil
					} else {
						return redis.Credentials{}, errors.New("wrong url")
					}
				}