Esempio n. 1
0
				Context("when the -r flag is not provided", func() {
					It("does not delete mapped routes", func() {
						runCommand("-f", "app-to-delete")
						Expect(routeRepo.DeleteCallCount()).To(BeZero())
					})
				})
			})
		})

		Context("when the app provided is not found", func() {
			BeforeEach(func() {
				appRepo.ReadReturns(models.Application{}, errors.NewModelNotFoundError("App", "the-app"))
			})

			It("warns the user when the provided app does not exist", func() {
				runCommand("-f", "app-to-delete")

				Expect(appRepo.ReadArgsForCall(0)).To(Equal("app-to-delete"))
				Expect(appRepo.DeleteCallCount()).To(BeZero())

				Expect(ui.Outputs).To(ContainSubstrings(
					[]string{"Deleting", "app-to-delete"},
					[]string{"OK"},
				))

				Expect(ui.WarnOutputs).To(ContainSubstrings([]string{"app-to-delete", "does not exist"}))
			})
		})
	})
})