Example #1
0
					requirementsFactory.Space = space
				})

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

					Ω(spaceRepo.SetAllowSSHCalls).To(Equal(1))
					Ω(spaceRepo.SetAllowSSHSpaceGuid).To(Equal("the-space-guid"))
					Ω(spaceRepo.SetAllowBoolValue).To(Equal(true))
					Ω(ui.Outputs).To(ContainSubstrings([]string{"Enabling ssh support for space 'the-space-name'"}))
					Ω(ui.Outputs).To(ContainSubstrings([]string{"OK"}))
				})
			})

			Context("Update fails", func() {
				It("notifies user of any api error", func() {
					spaceRepo.SetAllowSSHError = errors.New("api error")
					runCommand("the-space-name")

					Ω(ui.Outputs).To(ContainSubstrings(
						[]string{"FAILED"},
						[]string{"Error", "api error"},
					))
				})
			})

		})
	})

})