unit tests for habit service