Skip to content

Improve failure message of matcher require_graphql_authorizations

What does this MR do and why?

Before the message was missing details about permission names:

Mutation::Klass is expected to require graphql authorizations
:foo and :bar Failure/Error: specify { expect(described_class).to
  require_graphql_authorizations(:foo, :bar) } expected

  Mutations::Issues::Klass to require graphql authorizations :foo and :bar

Now, it's clear which permissions are missing and which are extra:

Mutation::Klass is expected to require graphql authorizations
:foo and :bar Failure/Error: specify { expect(described_class).to
  require_graphql_authorizations(:foo, :bar) }

  is missing permissions: [:bar]
  contained unexpected permissions: [:foo]

Note, the permission check is now order-independent.

Screenshots or screen recordings

n/a

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Peter Leitzen

Merge request reports