Beispiel #1
0
	Context("when logged in", func() {
		BeforeEach(func() {
			requirementsFactory.NewLoginRequirementReturns(requirements.Passing{})
		})

		Context("when the service instance exists", func() {
			It("unbinds a service from an app", func() {
				callUnbindService([]string{"my-app", "my-service"})

				Expect(ui.Outputs()).To(ContainSubstrings(
					[]string{"Unbinding app", "my-service", "my-app", "my-org", "my-space", "my-user"},
					[]string{"OK"},
				))

				Expect(serviceBindingRepo.DeleteCallCount()).To(Equal(1))
				serviceInstance, applicationGUID := serviceBindingRepo.DeleteArgsForCall(0)
				Expect(serviceInstance).To(Equal(serviceInstance))
				Expect(applicationGUID).To(Equal("my-app-guid"))
			})
		})

		Context("when the service instance does not exist", func() {
			BeforeEach(func() {
				serviceBindingRepo.DeleteReturns(false, nil)
			})

			It("warns the user the the service instance does not exist", func() {
				callUnbindService([]string{"my-app", "my-service"})

				Expect(ui.Outputs()).To(ContainSubstrings(