fix gravatar url is invalid when email contains upper characters

This commit is contained in:
MaysWind
2023-08-13 15:37:48 +08:00
parent 4ac78fe4d1
commit 17b8ac6d0b
2 changed files with 20 additions and 1 deletions
+14
View File
@@ -0,0 +1,14 @@
package utils
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestGetGravatarUrl(t *testing.T) {
// Reference: https://en.gravatar.com/site/implement/hash/
expectedValue := "https://www.gravatar.com/avatar/0bc83cb571cd1c50ba6f3e8a78ef1346"
actualValue := GetGravatarUrl("MyEmailAddress@example.com")
assert.Equal(t, expectedValue, actualValue)
}