From cb33179998c682bf1e48795d449d85f92cec97f7 Mon Sep 17 00:00:00 2001 From: Chris Date: Thu, 28 Sep 2017 15:31:23 -0500 Subject: PLT-7758: jira url fix (#7536) * jira url fix * whoops, forgot a file (the test file) --- app/plugin/jira/webhook_test.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 app/plugin/jira/webhook_test.go (limited to 'app/plugin/jira/webhook_test.go') diff --git a/app/plugin/jira/webhook_test.go b/app/plugin/jira/webhook_test.go new file mode 100644 index 000000000..25918657e --- /dev/null +++ b/app/plugin/jira/webhook_test.go @@ -0,0 +1,16 @@ +package jira + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +func TestWebhookJIRAURL(t *testing.T) { + var w Webhook + w.Issue.Self = "http://localhost:8080/rest/api/2/issue/10006" + assert.Equal(t, "http://localhost:8080", w.JIRAURL()) + + w.Issue.Self = "http://localhost:8080/foo/bar/rest/api/2/issue/10006" + assert.Equal(t, "http://localhost:8080/foo/bar", w.JIRAURL()) +} -- cgit v1.2.3-1-g7c22