Skip to content

Commit 0e664f5

Browse files
committed
fix connection nats
Signed-off-by: Miguel Martinez <miguel@chainloop.dev>
1 parent 36a312a commit 0e664f5

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

app/controlplane/pkg/authz/authz_test.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff 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

128132
func testEnforcer(t *testing.T) (*Enforcer, io.Closer) {

0 commit comments

Comments
 (0)