Module: Pundit::RSpec::Matchers

Extended by:
RSpec::Matchers::DSL
Included in:
PolicyExampleGroup
Defined in:
lib/pundit/rspec.rb

Overview

Namespace for Pundit’s RSpec matchers.

Since:

  • v0.1.0

Class Attribute Summary collapse

Class Attribute Details

.description(user, record) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Used to retrieve a suitable description for the Pundit ‘permit` matcher.

Since:

  • v0.1.0



29
30
31
32
33
# File 'lib/pundit/rspec.rb', line 29

def description(user, record)
  return @description.call(user, record) if defined?(@description) && @description.respond_to?(:call)

  @description
end