8
8
"net/http"
9
9
"os"
10
10
"testing"
11
+
12
+ "github.com/stretchr/testify/assert"
11
13
)
12
14
13
15
func skipLDAPTests () bool {
@@ -37,7 +39,7 @@ func addAuthSourceLDAP(t *testing.T) {
37
39
"filter" : "(&(objectClass=inetOrgPerson)(memberOf=cn=git,ou=people,dc=planetexpress,dc=com)(uid=%s))" ,
38
40
"admin_filter" : "(memberOf=cn=admin_staff,ou=people,dc=planetexpress,dc=com)" ,
39
41
"attribute_username" : "uid" ,
40
- "attribute_name" : "cn " ,
42
+ "attribute_name" : "givenName " ,
41
43
"attribute_surname" : "sn" ,
42
44
"attribute_mail" : "mail" ,
43
45
"is_sync_enabled" : "on" ,
@@ -53,5 +55,12 @@ func TestLDAPUserSignin(t *testing.T) {
53
55
}
54
56
prepareTestEnv (t )
55
57
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" ))
57
66
}
0 commit comments