blob: 4d05d0222e62d70317341a1389e7d43a19dc5395 [file] [log] [blame] [edit]
package main
import (
"testing"
"go.chromium.org/luci/common/testing/ftt"
"go.chromium.org/luci/common/testing/truth/assert"
"go.chromium.org/luci/common/testing/truth/should"
)
func TestGetGerritUrl(t *testing.T) {
ftt.Run("returns CL", t, func(t *ftt.Test) {
url := getGerritUrl("https://www.example.com/", "42")
assert.Loosely(t, url, should.Equal("https://www.example.com/c/42"))
})
ftt.Run("returns dashboard", t, func(t *ftt.Test) {
url := getGerritUrl("https://www.example.com/", "")
assert.Loosely(t, url, should.Equal("https://www.example.com/dashboard/self"))
})
}