Skip to content

Commit 33e63a8

Browse files
committed
test: tweak matcher
Recommended by a Gomega contributor. This solution with HaveValue BeFalse is more readable, and it doesn't impose a deep equal comparison.
1 parent 72d74b2 commit 33e63a8

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

controllers/user_controller_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import (
88
"github.com/rabbitmq/cluster-operator/v2/api/v1beta1"
99
"io"
1010
"k8s.io/apimachinery/pkg/labels"
11-
"k8s.io/utils/ptr"
1211
"net/http"
1312
"time"
1413

@@ -468,7 +467,7 @@ var _ = Describe("UserController", func() {
468467
Expect(generatedSecret.OwnerReferences).To(MatchElements(idFn, IgnoreExtras,
469468
Elements{
470469
"User": MatchFields(IgnoreExtras, Fields{
471-
"BlockOwnerDeletion": Equal(ptr.To(false)),
470+
"BlockOwnerDeletion": HaveValue(BeFalseBecause("it should not block owner deletion")),
472471
}),
473472
},
474473
))

0 commit comments

Comments
 (0)