-
-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixes: add provider to v2, remove email scope and cleanup indent in R…
…EADME
- Loading branch information
Showing
6 changed files
with
45 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -208,3 +208,16 @@ func TestProviders_NewPatreon(t *testing.T) { | |
user, | ||
) | ||
} | ||
|
||
func TestProviders_NewDiscord(t *testing.T) { | ||
r := NewDiscord(Params{URL: "http://demo.remark42.com", Cid: "cid", Csecret: "cs"}) | ||
assert.Equal(t, "discord", r.Name()) | ||
|
||
t.Run("With all data", func(t *testing.T) { | ||
udata := UserData{"id": "248533295981532", "username": "test_user", "avatar": "374384984773", "email": "[email protected]"} | ||
user := r.mapUser(udata, nil) | ||
assert.Equal(t, token.User{Name: "test_user", ID: "discord_9b472605c1318483fb4b88f9acf22cdd4219f9a0", Email: "[email protected]", | ||
Picture: "https://cdn.discordapp.com/avatars/248533295981532/374384984773.webp"}, user, "got %+v", user) | ||
}) | ||
|
||
} |