I have a method that can be accessed only by an admin. I want to test it with mocha. But every time I want to add my test user to the admin role, I have the error:
1) sessionDates methods "before all" hook:
Error: Role 'admin' does not exist.
What am I doing wrong? Do you have to subscribe to the roles in the test too? But how to do that?
Hi!
I have a method that can be accessed only by an admin. I want to test it with mocha. But every time I want to add my test user to the admin role, I have the error:
What am I doing wrong? Do you have to subscribe to the roles in the test too? But how to do that?
Thanks for any answer or tips.
Here my test code: