Failures:
1) CanCan::Ability passes object and additional attributes when calling with class
Failure/Error: expect(@block_called).to be(true)
expected true
got nil
# ./spec/cancan/ability_spec.rb:122:in `block (2 levels) in <top (required)>'
Who is right - code or documentation? Can submit a PR if needed.
Thanks!
Example:
cancancan/lib/cancan/ability.rb
Lines 50 to 57 in 1100093
Implemented in a test: https://github.com/egor-khanko/cancancan/blob/f64bb73f0adb6cc5e96fa69ba4a881ae60fe42d2/spec/cancan/ability_spec.rb#L115-L123
Test fails, as the block never called:
It is caused by following check, which passes and falls back to default behaviour: https://github.com/CanCanCommunity/cancancan/blob/develop/lib/cancan/conditions_matcher.rb#L22
Who is right - code or documentation? Can submit a PR if needed.
Thanks!