Sha256: 42024a5e358e49e35a5f0cac4dec30e22234368878e870b3c735dde1a8321e03

Contents?: true

Size: 389 Bytes

Versions: 31

Compression:

Stored size: 389 Bytes

Contents

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

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

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

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
introspective_grape-0.6.1 spec/support/pundit_helpers.rb
introspective_grape-0.5.7 spec/support/pundit_helpers.rb
introspective_grape-0.5.6 spec/support/pundit_helpers.rb
introspective_grape-0.5.5 spec/support/pundit_helpers.rb
introspective_grape-0.5.4 spec/support/pundit_helpers.rb
introspective_grape-0.5.2 spec/support/pundit_helpers.rb
introspective_grape-0.5.0 spec/support/pundit_helpers.rb
introspective_grape-0.4.3 spec/support/pundit_helpers.rb
introspective_grape-0.4.2 spec/support/pundit_helpers.rb
introspective_grape-0.4.1 spec/support/pundit_helpers.rb
introspective_grape-0.4.0 spec/support/pundit_helpers.rb
introspective_grape-0.3.9 spec/support/pundit_helpers.rb
introspective_grape-0.3.7 spec/support/pundit_helpers.rb
introspective_grape-0.3.6 spec/support/pundit_helpers.rb
introspective_grape-0.3.5 spec/support/pundit_helpers.rb
introspective_grape-0.3.3 spec/support/pundit_helpers.rb
introspective_grape-0.3.2 spec/support/pundit_helpers.rb
introspective_grape-0.3.1 spec/support/pundit_helpers.rb
introspective_grape-0.3.0 spec/support/pundit_helpers.rb
introspective_grape-0.2.9 spec/support/pundit_helpers.rb