(t *testing.T)
| 221 | } |
| 222 | |
| 223 | func TestValidateWebhookConfig(t *testing.T) { |
| 224 | var nthConfig = config.Config{} |
| 225 | err := webhook.ValidateWebhookConfig(nthConfig) |
| 226 | h.Ok(t, err) |
| 227 | |
| 228 | nthConfig.WebhookURL = "http://123.123.123" |
| 229 | nthConfig.WebhookTemplate = "{{ " |
| 230 | err = webhook.ValidateWebhookConfig(nthConfig) |
| 231 | h.Assert(t, err != nil, "Failed to return error for failing to parse webhook template") |
| 232 | |
| 233 | nthConfig.WebhookTemplate = "{{.cat}}" |
| 234 | err = webhook.ValidateWebhookConfig(nthConfig) |
| 235 | h.Assert(t, err != nil, "Failed to return error for failing to execute webhook template") |
| 236 | |
| 237 | nthConfig.WebhookTemplate = testWebhookTemplate |
| 238 | err = webhook.ValidateWebhookConfig(nthConfig) |
| 239 | h.Ok(t, err) |
| 240 | } |
nothing calls this directly
no test coverage detected