Refactor: migrate discordbot
All checks were successful
All checks were successful
This commit is contained in:
@@ -18,7 +18,7 @@ func Test_01_Login(t *testing.T) {
|
||||
t.Run("check preshared key failed", func(t *testing.T) {
|
||||
resp, err := client.R().
|
||||
SetBody(`{"userId": "testuser1"}`).
|
||||
Post("/auth/gen-login-url")
|
||||
Post("/bot/auth/gen-login-url")
|
||||
if err != nil {
|
||||
t.Fatal("request failed")
|
||||
}
|
||||
@@ -32,7 +32,7 @@ func Test_01_Login(t *testing.T) {
|
||||
SetBody(`{"userId": "testuser1"}`).
|
||||
SetAuthToken("poop").
|
||||
SetResult(&payload).
|
||||
Post("/auth/gen-login-url")
|
||||
Post("/bot/auth/gen-login-url")
|
||||
|
||||
if err != nil || resp.StatusCode() != http.StatusOK {
|
||||
t.Fatal("failed to get login url")
|
||||
@@ -46,7 +46,8 @@ func Test_01_Login(t *testing.T) {
|
||||
|
||||
resp, err = client.R().
|
||||
SetBody(loginPayload{Token: loginUrl.Query().Get("token")}).
|
||||
Post(loginUrl.Scheme + "://" + loginUrl.Host + "/auth/login")
|
||||
SetAuthToken("poop").
|
||||
Post("/auth/login")
|
||||
if err != nil || resp.StatusCode() != http.StatusOK {
|
||||
t.Fatal("failed to login")
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ var aliases []aliasPayload
|
||||
func Test_04_GetAliases(t *testing.T) {
|
||||
resp, err := client.R().
|
||||
SetResult(&aliases).
|
||||
Get("http://localhost:8080/api/aliases")
|
||||
Get("/api/aliases")
|
||||
if err != nil || resp.StatusCode() != http.StatusOK {
|
||||
t.Logf("%+v", resp)
|
||||
t.Fatal("failed to get aliases")
|
||||
|
||||
Reference in New Issue
Block a user