示例#1
0
			})
		})

		Context("Updating allow_ssh when not already set to false", func() {
			Context("Update successfully", func() {
				BeforeEach(func() {
					space.AllowSSH = true
					spaceReq := new(requirementsfakes.FakeSpaceRequirement)
					spaceReq.GetSpaceReturns(space)
					requirementsFactory.NewSpaceRequirementReturns(spaceReq)
				})

				It("updates the space's allow_ssh", func() {
					runCommand("the-space-name")

					Expect(spaceRepo.SetAllowSSHCallCount()).To(Equal(1))
					spaceGUID, allow := spaceRepo.SetAllowSSHArgsForCall(0)
					Expect(spaceGUID).To(Equal("the-space-guid"))
					Expect(allow).To(Equal(false))
					Expect(ui.Outputs()).To(ContainSubstrings([]string{"Disabling ssh support for space 'the-space-name'"}))
					Expect(ui.Outputs()).To(ContainSubstrings([]string{"OK"}))
				})
			})

			Context("Update fails", func() {
				BeforeEach(func() {
					space.AllowSSH = true
					spaceReq := new(requirementsfakes.FakeSpaceRequirement)
					spaceReq.GetSpaceReturns(space)
					requirementsFactory.NewSpaceRequirementReturns(spaceReq)
				})