File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
app/controlplane/pkg/authz Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -111,8 +111,7 @@ func TestDoSync(t *testing.T) {
111111 assert .NoError (t , err )
112112 assert .Len (t , got , 1 )
113113
114- // add additional policy, only deletes policies for "known" resources
115- // or deleting a whole section
114+ // replace policy for a role - old policies are removed and new ones added
116115 policiesM = map [Role ][]* Policy {
117116 "bar" : {
118117 PolicyAttachedIntegrationDetach ,
@@ -122,7 +121,12 @@ func TestDoSync(t *testing.T) {
122121 assert .NoError (t , err )
123122 got , err = e .GetPolicy ()
124123 assert .NoError (t , err )
125- assert .Len (t , got , 2 )
124+ assert .Len (t , got , 1 )
125+
126+ // verify the new policy is present
127+ assert .Equal (t , "bar" , got [0 ][0 ])
128+ assert .Equal (t , "integration_attached" , got [0 ][1 ])
129+ assert .Equal (t , "delete" , got [0 ][2 ])
126130}
127131
128132func testEnforcer (t * testing.T ) (* Enforcer , io.Closer ) {
You can’t perform that action at this time.
0 commit comments