Sha256: 93a532203acd55175abd8b29d190c3b656a5a8b2641afc4c1e6f5660f206c305

Contents?: true

Size: 402 Bytes

Versions: 19

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

19 entries across 19 versions & 1 rubygems

Version Path
storytime-2.1.6 spec/support/pundit_matcher.rb
storytime-2.1.5 spec/support/pundit_matcher.rb
storytime-2.1.4 spec/support/pundit_matcher.rb
storytime-2.1.3 spec/support/pundit_matcher.rb
storytime-2.1.2 spec/support/pundit_matcher.rb
storytime-2.1.1 spec/support/pundit_matcher.rb
storytime-2.1.0 spec/support/pundit_matcher.rb
storytime-2.0.0 spec/support/pundit_matcher.rb
storytime-1.2.0 spec/support/pundit_matcher.rb
storytime-1.1.1 spec/support/pundit_matcher.rb
storytime-1.0.7 spec/support/pundit_matcher.rb
storytime-1.0.6 spec/support/pundit_matcher.rb
storytime-1.0.5 spec/support/pundit_matcher.rb
storytime-1.0.2 spec/support/pundit_matcher.rb
storytime-1.0.1 spec/support/pundit_matcher.rb
storytime-1.0.0 spec/support/pundit_matcher.rb
storytime-0.0.4 spec/support/pundit_matcher.rb
storytime-0.0.2 spec/support/pundit_matcher.rb
storytime-0.0.1 spec/support/pundit_matcher.rb