Example #1
0
			Expect(testcmd.CommandDidPassRequirements).To(BeFalse())
		})
	})

	Context("when logged in and given a zone to update", func() {
		BeforeEach(func() {
			zone := models.Zone{
				models.ZoneFields{
					Name:        "the-old-zone-name",
					Guid:        "the-old-zone-guid",
					Priority:    30,
					IsPublic:    true,
					Description: "the-old-description",
				},
			}
			requirementsFactory.Zone = zone
			requirementsFactory.LoginSuccess = true
		})

		It("fails when no options given", func() {
			runCommand("my-zone")
			Expect(ui.Outputs).To(ContainSubstrings(
				[]string{"FAILED"},
				[]string{"No options given"},
			))
		})

		It("passes requirements", func() {
			runCommand("-z", "the-new-zone-name", "the-old-zone-name")
			Expect(testcmd.CommandDidPassRequirements).To(BeTrue())
		})