wrote a test for authenticate