• Peter Leitzen's avatar
    Improve failure message of matcher require_graphql_authorizations · 8958858d
    Peter Leitzen authored
    Before the message was missing details about permission names:
    
    Mutation::Issues::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::Issues::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.
    8958858d
graphql_matchers.rb 5.95 KB