Sha256: 83c96744ed3eb12b15822b44ed6c7409317cfbf5ba030c201c04490f0b1ecc1a

Contents?: true

Size: 402 Bytes

Versions: 16

Compression:

Stored size: 402 Bytes

Contents

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

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

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

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
renalware-core-2.0.0.pre.rc11 spec/support/pundit_matcher.rb
renalware-core-2.0.0.pre.rc10 spec/support/pundit_matcher.rb
renalware-core-2.0.0.pre.rc9 spec/support/pundit_matcher.rb
renalware-core-2.0.0.pre.rc8 spec/support/pundit_matcher.rb
renalware-core-2.0.0.pre.rc7 spec/support/pundit_matcher.rb
renalware-core-2.0.0.pre.rc6 spec/support/pundit_matcher.rb
renalware-core-2.0.0.pre.rc5 spec/support/pundit_matcher.rb
renalware-core-2.0.0.pre.rc4 spec/support/pundit_matcher.rb
renalware-core-2.0.0.pre.rc3 spec/support/pundit_matcher.rb
renalware-core-2.0.0.pre.rc1 spec/support/pundit_matcher.rb
renalware-core-2.0.0.pre.beta12 spec/support/pundit_matcher.rb
renalware-core-2.0.0.pre.beta11 spec/support/pundit_matcher.rb
renalware-core-2.0.0.pre.beta10 spec/support/pundit_matcher.rb
renalware-core-2.0.0.pre.beta9 spec/support/pundit_matcher.rb
renalware-core-2.0.0.pre.beta8 spec/support/pundit_matcher.rb
renalware-core-2.0.0.pre.beta7 spec/support/pundit_matcher.rb