woodpecker/plugin/notify/notify_test.go
Ciaran Downey 0a0151fa5e Adjust Slack message format to match HipChat's
Also add some tests for formatting. See #586.
2014-10-22 22:26:14 -07:00

28 lines
544 B
Go

package notify
import (
"testing"
"github.com/drone/drone/shared/model"
)
func Test_getBuildUrl(t *testing.T) {
c := &model.Request{
Host: "http://examplehost.com",
Repo: &model.Repo{
Host: "examplegit.com",
Owner: "owner",
Name: "repo",
},
Commit: &model.Commit{
Sha: "abc",
Branch: "example",
},
}
expected := "http://examplehost.com/examplegit.com/owner/repo/example/abc"
output := getBuildUrl(c)
if output != expected {
t.Errorf("Failed to build url. Expected: %s, got %s", expected, output)
}
}