@@ -515,7 +515,7 @@ func TestOAuth_GrantScopesReadUserFailRepos(t *testing.T) {
515515 err := db .Insert (db .DefaultContext , grant )
516516 require .NoError (t , err )
517517
518- assert .ElementsMatch (t , [] string { "openid" , "profile" , " email" , " read:user"}, strings . Split ( grant . Scope , " " ) )
518+ assert .Contains (t , grant . Scope , "openid profile email read:user" )
519519
520520 ctx := loginUserWithPasswordRemember (t , user .Name , "password" , true )
521521
@@ -596,7 +596,7 @@ func TestOAuth_GrantScopesReadRepositoryFailOrganization(t *testing.T) {
596596 err := db .Insert (db .DefaultContext , grant )
597597 require .NoError (t , err )
598598
599- assert .ElementsMatch (t , [] string { "openid" , "profile" , " email" , " read:user" , " read:repository"}, strings . Split ( grant . Scope , " " ) )
599+ assert .Contains (t , grant . Scope , "openid profile email read:user read:repository" )
600600
601601 ctx := loginUserWithPasswordRemember (t , user .Name , "password" , true )
602602
@@ -790,7 +790,7 @@ func TestOAuth_GrantScopesClaimGroupsAll(t *testing.T) {
790790 }
791791}
792792
793- func TestOAuth_GrantScopesClaimGroupsPublicOnly (t * testing.T ) {
793+ func TestOAuth_GrantScopesEnabledClaimGroups (t * testing.T ) {
794794 defer tests .PrepareTestEnv (t )()
795795
796796 user := unittest .AssertExistsAndLoadBean (t , & user_model.User {Name : "user2" })
@@ -819,7 +819,7 @@ func TestOAuth_GrantScopesClaimGroupsPublicOnly(t *testing.T) {
819819 err := db .Insert (db .DefaultContext , grant )
820820 require .NoError (t , err )
821821
822- assert .ElementsMatch (t , [] string { "openid" , "profile" , " email" , " groups"}, strings . Split ( grant . Scope , " " ) )
822+ assert .Contains (t , grant . Scope , "openid profile email groups" )
823823
824824 ctx := loginUserWithPasswordRemember (t , user .Name , "password" , true )
825825
0 commit comments