2015-10-08 12:27:09 -04:00
|
|
|
// Copyright (c) 2015 Mattermost, Inc. All Rights Reserved.
|
2015-06-14 23:53:32 -08:00
|
|
|
// See License.txt for license information.
|
|
|
|
|
|
|
|
|
|
package api
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"testing"
|
|
|
|
|
)
|
|
|
|
|
|
2016-10-12 06:51:57 -07:00
|
|
|
func TestSiteURL(t *testing.T) {
|
|
|
|
|
c := &Context{}
|
|
|
|
|
|
|
|
|
|
testCases := []struct {
|
|
|
|
|
url string
|
|
|
|
|
want string
|
|
|
|
|
}{
|
|
|
|
|
{"http://mattermost.com/", "http://mattermost.com"},
|
|
|
|
|
{"http://mattermost.com", "http://mattermost.com"},
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for _, tc := range testCases {
|
|
|
|
|
c.SetSiteURL(tc.url)
|
|
|
|
|
|
|
|
|
|
if c.siteURL != tc.want {
|
|
|
|
|
t.Fatalf("expected %s, got %s", tc.want, c.siteURL)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|