duffee / Mojolicious_session_example

A simple Mojolicious application example for authenticating a user and maintaining a session
Artistic License 2.0
9 stars 5 forks source link

Re-write Test for LDAP #13

Open duffee opened 8 years ago

duffee commented 8 years ago

from Oliver Günther:

Do not write special code for testing within the controller or model at any time in the tutorial, as others might likely copy and paste it in their production code.

Instead, override behavior in the tests (e.g. with Mock::Quick ) or better, use a LDAP server you can spawn directly within the tests: Net::LDAP::Server::Test

With 'auto_schema' set in the LDAP test server, you can simply add users to your liking and use the same code for testing as for production.