示例#1
0
					CacheKey: "elephant",
					User:     "******",
				}),
			)

			Describe("Validate", func() {

				Context("when the action has 'from', 'to', and 'user' specified", func() {
					It("is valid", func() {
						downloadAction = &models.DownloadAction{
							From: "web_location",
							To:   "local_location",
							User: "******",
						}

						err := downloadAction.Validate()
						Expect(err).NotTo(HaveOccurred())
					})
				})

				for _, testCase := range []ValidatorErrorCase{
					{
						"from",
						&models.DownloadAction{
							To: "local_location",
						},
					},
					{
						"to",
						&models.DownloadAction{
							From: "web_location",