Skip to content

Commit e357a83

Browse files
committed
Add checks to test if user data is correct
1 parent 4b01a54 commit e357a83

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

integrations/auth_ldap_test.go

+11-2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ import (
88
"net/http"
99
"os"
1010
"testing"
11+
12+
"github.com/stretchr/testify/assert"
1113
)
1214

1315
func skipLDAPTests() bool {
@@ -37,7 +39,7 @@ func addAuthSourceLDAP(t *testing.T) {
3739
"filter": "(&(objectClass=inetOrgPerson)(memberOf=cn=git,ou=people,dc=planetexpress,dc=com)(uid=%s))",
3840
"admin_filter": "(memberOf=cn=admin_staff,ou=people,dc=planetexpress,dc=com)",
3941
"attribute_username": "uid",
40-
"attribute_name": "cn",
42+
"attribute_name": "givenName",
4143
"attribute_surname": "sn",
4244
"attribute_mail": "mail",
4345
"is_sync_enabled": "on",
@@ -53,5 +55,12 @@ func TestLDAPUserSignin(t *testing.T) {
5355
}
5456
prepareTestEnv(t)
5557
addAuthSourceLDAP(t)
56-
loginUserWithPassword(t, "fry", "fry")
58+
session := loginUserWithPassword(t, "fry", "fry")
59+
req := NewRequest(t, "GET", "/user/settings")
60+
resp := session.MakeRequest(t, req, http.StatusOK)
61+
62+
htmlDoc := NewHTMLParser(t, resp.Body)
63+
assert.Equal(t, "fry", htmlDoc.GetInputValueByName("username"))
64+
assert.Equal(t, "Philip Fry", htmlDoc.GetInputValueByName("full_name"))
65+
assert.Equal(t, "[email protected]", htmlDoc.GetInputValueByName("email"))
5766
}

0 commit comments

Comments
 (0)