Beispiel #1
0
						Protocol:     "tcp",
						Destinations: []string{"0.0.0.0/0"},
						Ports:        []uint16{80, 443},
						Log:          true,
					},
				},
			}

			Expect(actualResponse).To(Equal(expectedResponse))
		})

		Context("when the task has a CompletionCallbackURL", func() {
			BeforeEach(func() {
				task.CompletionCallbackURL = &url.URL{
					Scheme: "http",
					Host:   "example.com",
					Path:   "/the-path",
				}
			})

			It("serializes the completion callback URL", func() {
				Expect(serialization.TaskToResponse(task).CompletionCallbackURL).To(Equal("http://example.com/the-path"))
			})
		})

		Context("when the task doesn't have a CompletionCallbackURL", func() {
			It("leaves the completion callback URL blank", func() {
				Expect(serialization.TaskToResponse(task).CompletionCallbackURL).To(Equal(""))
			})
		})
	})