Closed robertoperez-digital closed 1 year ago
Sorry to bother, I found my problem. It was the Bouncer cache trolling me, after the call I tested using
Bouncer::refresh();
And
$user->can('ability', $object);
Returned true as expected
I disabled cache for the whole test
Hi! I'm facing a weird issue
In my feature test I call this
In the controller function I do
After the call I check in my test if
$user->can('ability', $object);
It doesn't return true, I printed the result and is not true, nor false, is like empty??Additional info: I have a custom Ability class registered in AppServiceProvider
Bouncer::useAbilityModel(Ability::class);
Funny thing, If I call that endpoint from an external tool like postman, everything is working as expected, it is just acting weird in the tests.
Can you give some light on this?
Any info you can give will be very appreciated.
Thank you.