lib/pundit/matchers/actions_matcher.rb in pundit-matchers-3.0.0 vs lib/pundit/matchers/actions_matcher.rb in pundit-matchers-3.0.1
- old
+ new
@@ -39,10 +39,11 @@
private
attr_reader :expected_actions
def check_actions!
- missing_actions = expected_actions - policy_info.actions
+ non_explicit_actions = (expected_actions - policy_info.actions)
+ missing_actions = non_explicit_actions.reject { |action| policy_info.policy.respond_to?(:"#{action}?") }
return if missing_actions.empty?
raise ArgumentError, format(
ACTIONS_NOT_IMPLEMENTED_ERROR,
policy: policy_info, actions: missing_actions