blob: a8f2d3f1410e80dcc51e31ad1bf948b1e06dfd5e [file] [log] [blame]
package auth
import (
"net/http/httptest"
"testing"
"github.com/stretchr/testify/require"
)
func testLoginURL(t *testing.T, expected, domain string) {
t.Helper()
l := New()
w := httptest.NewRecorder()
r := httptest.NewRequest("GET", "/", nil)
r.Host = domain
require.Equal(t, expected, l.LoginURL(w, r))
}
func TestAuthImpl_LoginURL(t *testing.T) {
testLoginURL(t, "https://skia.org/login/", "foo.skia.org")
testLoginURL(t, "https://luci.app/login/", "perf.luci.app")
}