aboutsummaryrefslogtreecommitdiffstats
path: root/tests/integration/auth_ldap_test.go
diff options
context:
space:
mode:
authorKN4CK3R <admin@oldschoolhack.me>2023-04-22 23:56:27 +0200
committerGitHub <noreply@github.com>2023-04-22 17:56:27 -0400
commitf1173d6879cb26af21483037fae72542f3088408 (patch)
treea1ed73fb2a42c351005974698076f5ee82489d5d /tests/integration/auth_ldap_test.go
parentac384c4e1d207a989d0f646ebc14fd0c26427d4c (diff)
downloadgitea-f1173d6879cb26af21483037fae72542f3088408.tar.gz
gitea-f1173d6879cb26af21483037fae72542f3088408.zip
Use more specific test methods (#24265)
Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: Giteabot <teabot@gitea.io>
Diffstat (limited to 'tests/integration/auth_ldap_test.go')
-rw-r--r--tests/integration/auth_ldap_test.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/integration/auth_ldap_test.go b/tests/integration/auth_ldap_test.go
index 883c9d80a3..81f8d9ddd7 100644
--- a/tests/integration/auth_ldap_test.go
+++ b/tests/integration/auth_ldap_test.go
@@ -203,7 +203,7 @@ func TestLDAPAuthChange(t *testing.T) {
host, _ := doc.Find(`input[name="host"]`).Attr("value")
assert.Equal(t, host, getLDAPServerHost())
binddn, _ := doc.Find(`input[name="bind_dn"]`).Attr("value")
- assert.Equal(t, binddn, "uid=gitea,ou=service,dc=planetexpress,dc=com")
+ assert.Equal(t, "uid=gitea,ou=service,dc=planetexpress,dc=com", binddn)
req = NewRequestWithValues(t, "POST", href, buildAuthSourceLDAPPayload(csrf, "", "", "", "off"))
session.MakeRequest(t, req, http.StatusSeeOther)
@@ -214,7 +214,7 @@ func TestLDAPAuthChange(t *testing.T) {
host, _ = doc.Find(`input[name="host"]`).Attr("value")
assert.Equal(t, host, getLDAPServerHost())
binddn, _ = doc.Find(`input[name="bind_dn"]`).Attr("value")
- assert.Equal(t, binddn, "uid=gitea,ou=service,dc=planetexpress,dc=com")
+ assert.Equal(t, "uid=gitea,ou=service,dc=planetexpress,dc=com", binddn)
}
func TestLDAPUserSync(t *testing.T) {
@@ -397,8 +397,8 @@ func TestLDAPGroupTeamSyncAddMember(t *testing.T) {
assert.NoError(t, err)
if user.Name == "fry" || user.Name == "leela" || user.Name == "bender" {
// assert members of LDAP group "cn=ship_crew" are added to mapped teams
- assert.Equal(t, len(usersOrgs), 1, "User [%s] should be member of one organization", user.Name)
- assert.Equal(t, usersOrgs[0].Name, "org26", "Membership should be added to the right organization")
+ assert.Len(t, usersOrgs, 1, "User [%s] should be member of one organization", user.Name)
+ assert.Equal(t, "org26", usersOrgs[0].Name, "Membership should be added to the right organization")
isMember, err := organization.IsTeamMember(db.DefaultContext, usersOrgs[0].ID, team.ID, user.ID)
assert.NoError(t, err)
assert.True(t, isMember, "Membership should be added to the right team")