Sha256: 7be4df7eef40a8fa719603da96323afbde9323796388083671b8489cb475f58a

Contents?: true

Size: 473 Bytes

Versions: 24

Compression:

Stored size: 473 Bytes

Contents

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

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

  failure_message_when_negated do |policy|
    <<~STRING
      #{policy.class} does not forbid #{action} on
       #{policy.record} for #{policy.user.inspect}.
    STRING
  end
end
# :nocov:

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
pg_rails-7.6.27 pg_rails/lib/pg_rails/pundit_matchers.rb
pg_rails-7.6.26 pg_rails/lib/pg_rails/pundit_matchers.rb
pg_rails-7.6.25 pg_rails/lib/pg_rails/pundit_matchers.rb
pg_rails-7.6.24 pg_rails/lib/pg_rails/pundit_matchers.rb
pg_rails-7.6.24.pre.5 pg_rails/lib/pg_rails/pundit_matchers.rb
pg_rails-7.6.24.pre.4 pg_rails/lib/pg_rails/pundit_matchers.rb
pg_rails-7.6.24.pre.3 pg_rails/lib/pg_rails/pundit_matchers.rb
pg_rails-7.6.23 pg_rails/lib/pg_rails/pundit_matchers.rb
pg_rails-7.6.22 pg_rails/lib/pg_rails/pundit_matchers.rb
pg_rails-7.6.22.pre.3 pg_rails/lib/pg_rails/pundit_matchers.rb
pg_rails-7.6.22.pre.2 pg_rails/lib/pg_rails/pundit_matchers.rb
pg_rails-7.6.22.pre.1 pg_rails/lib/pg_rails/pundit_matchers.rb
pg_rails-7.6.21 pg_rails/lib/pg_rails/pundit_matchers.rb
pg_rails-7.6.21.pre.11 pg_rails/lib/pg_rails/pundit_matchers.rb
pg_rails-7.6.21.pre.10 pg_rails/lib/pg_rails/pundit_matchers.rb
pg_rails-7.6.21.pre.9 pg_rails/lib/pg_rails/pundit_matchers.rb
pg_rails-7.6.21.pre.8 pg_rails/lib/pg_rails/pundit_matchers.rb
pg_rails-7.6.21.pre.7 pg_rails/lib/pg_rails/pundit_matchers.rb
pg_rails-7.6.21.pre.6 pg_rails/lib/pg_rails/pundit_matchers.rb
pg_rails-7.6.21.pre.5 pg_rails/lib/pg_rails/pundit_matchers.rb