One pattern for Pundit with closed systems is to throw a Pundit::NotAuthorizedError on initialize when the user is nil. It would be nice to test this using the lovely pundit-matchers type syntax:
` it { is_expected.to raise_not_authorized(:index) }`
I am happy to send a pr.