Summer Sale! All accounts are 50% off this week.

vishalkpatel's avatar

Testing when app has multiple guards

My app has multiple auth guards and there are different routes for each guard. I want to test that the route for one guard cannot be accessed by another guards. The one way to do this is to access the that route when logged into each guard and then assert the response. But I want to know if there's any other better way to do that.

Instead of testing every other guard access to that route, can I not test that only a intended guard can access that route.

Thanks in advance!

0 likes
2 replies
jlrdw's avatar

Do the guards work in real world?

vishalkpatel's avatar

@jlrdw Sorry, I don't understand your point. I've all the different auth guards working as expected in my App. I just want to know the better way to test them.

Please or to participate in this conversation.