Sha256: 0cf0982f595f7321a75c816cffae4340796a4ed19bcfea5c589beea21aca7831

Contents?: true

Size: 394 Bytes

Versions: 3

Compression:

Stored size: 394 Bytes

Contents

RSpec::Matchers.define :permit_auth do |action|
  match do |policy|
    policy.public_send("#{action}?")
  end

  failure_message do |policy|
    "#{policy.class} does not permit #{action} on #{policy.record} for #{policy.user.inspect}."
  end

  failure_message_when_negated do |policy|
    "#{policy.class} does not forbid #{action} on #{policy.record} for #{policy.user.inspect}."
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
natural_resource-0.2.0 lib/generators/natural/install/templates/pundit.rb
natural_resource-0.1.6 lib/generators/natural/install/templates/pundit.rb
natural_resource-0.1.5 lib/generators/natural/install/templates/pundit.rb