write tests for login and logout