diff --git a/cmd/download_test.go b/cmd/download_test.go index a3e565831..d95729719 100644 --- a/cmd/download_test.go +++ b/cmd/download_test.go @@ -26,7 +26,7 @@ func TestDownloadWithoutToken(t *testing.T) { if assert.Error(t, err) { assert.Regexp(t, "Welcome to Exercism", err.Error()) // It uses the default base API url to infer the host - assert.Regexp(t, "exercism.org/settings/api_cli", err.Error()) + assert.Regexp(t, "exercism.io/my/settings", err.Error()) } } diff --git a/cmd/submit_test.go b/cmd/submit_test.go index c974794c8..2a12d0bca 100644 --- a/cmd/submit_test.go +++ b/cmd/submit_test.go @@ -28,7 +28,7 @@ func TestSubmitWithoutToken(t *testing.T) { err := runSubmit(cfg, pflag.NewFlagSet("fake", pflag.PanicOnError), []string{}) if assert.Error(t, err) { assert.Regexp(t, "Welcome to Exercism", err.Error()) - assert.Regexp(t, "exercism.org/settings/api_cli", err.Error()) + assert.Regexp(t, "exercism.io/my/settings", err.Error()) } } diff --git a/config/config.go b/config/config.go index e70595054..b9b1883ba 100644 --- a/config/config.go +++ b/config/config.go @@ -12,7 +12,7 @@ import ( ) var ( - defaultBaseURL = "https://exercism.org" + defaultBaseURL = "https://api.exercism.io/v1" // DefaultDirName is the default name used for config and workspace directories. DefaultDirName string @@ -122,7 +122,7 @@ func InferSiteURL(apiURL string) string { apiURL = defaultBaseURL } if apiURL == "https://api.exercism.io/v1" { - return "https://exercism.org" + return "https://exercism.io" } re := regexp.MustCompile("^(https?://[^/]*).*") return re.ReplaceAllString(apiURL, "$1") @@ -130,5 +130,5 @@ func InferSiteURL(apiURL string) string { // SettingsURL provides a link to where the user can find their API token. func SettingsURL(apiURL string) string { - return fmt.Sprintf("%s%s", InferSiteURL(apiURL), "/settings/api_cli") + return fmt.Sprintf("%s%s", InferSiteURL(apiURL), "/my/settings") } diff --git a/config/config_test.go b/config/config_test.go index 2df6ce1fd..e9d29f97f 100644 --- a/config/config_test.go +++ b/config/config_test.go @@ -10,11 +10,11 @@ func TestInferSiteURL(t *testing.T) { testCases := []struct { api, url string }{ - {"https://api.exercism.io/v1", "https://exercism.org"}, + {"https://api.exercism.io/v1", "https://exercism.io"}, {"https://v2.exercism.io/api/v1", "https://v2.exercism.io"}, {"https://mentors-beta.exercism.io/api/v1", "https://mentors-beta.exercism.io"}, {"http://localhost:3000/api/v1", "http://localhost:3000"}, - {"", "https://exercism.org"}, // use the default + {"", "https://exercism.io"}, // use the default {"http://whatever", "http://whatever"}, // you're on your own, pal }