reorganized the test and added auth unit test